Tally Robb's 97th-minute winner over Spartans secured ninth place for Montrose in their first ever season in the SWPL top flight.
Spartans led 3-2 in the 85th minute before two late goals - including one from retiring captain Tammy Harkin in her final home game for the club - flipped the game on its head.
Louise Brown got the scoring underway for Craig Feroz's side just before the half hour mark, capitalising after Spartans failed to clear their lines.
It remained 1-0 until the break but the visitors reacted quickly in the second, with Caley Gibb striking in the 48th minute after controlling Erin Henderson's pass.
Spartans keeper Alicia Yates put the hosts back in front when she carried the ball over her own line from a corner, but Henderson turned from provider to scorer to level the scores again.
Mya Bates' tapped home a Gibb cross to put Spartans in front for the first time in the match, but that lead would only last four minutes.
Harkin, who announced her retirement on Sunday, scored late on before Robb scored her first goal of the season to give Montrose the win.