Sligo will play division three football next year.
Victory today over Andy Moran's Leitrim in Carrick on Shannon means that Sligo finish top of the table, and will face Wicklow in the final next weekend.
Sligo held a good lead midway through the second half after Pat Spillane's goal.
But suddenly, Leitrim found the net themselves to bring the margin back to five points.
Barry McNulty's goal was followed up by a second from Aidan Flynn with just over five minutes remaining.
Leitrim added more scores with Tom Prior putting them ahead by a point which was cancelled out by Finnian Cawley.
In the dying stages, Sean Carrabine once again stepped up to win the game for Sligo with a point to send them back to the third tier.
Full time score from Avant Money Páirc Seán Mac Diarmada:
Leitrim 2-11 (17) Sligo 1-15 (18)