Craig Dargo's late header earned third-placed Dumbarton a victory that relegated Stirling Albion from the Scottish Second Division.
Patrick Walker could have given the visitors an early lead but he failed to control his shot after breaking into the area.
The hosts' first opportunity fell to Graham Weir but he failed to find a way past Stephen Grindlay with a tame effort.
Grindlay's opposite number was given a more stern test as Callum Reidford spread himself well to block at the feet of Walker.
Alan Lithgow was next to go close but Reidford did well to tip his effort over the bar.
They broke the deadlock just before the hour mark, Scott Davidson finishing from close range after good work by Darren Smith.
But they were pegged back 12 minutes from time when Devon Jacobs turned Scott Agnew's corner past his own keeper.
However, substitute Dargo headed home Agnew's cross in stoppage time to snatch three points.
Stirling: Reidford, Jacobs, Thom, Allison, Crawley, McCunnie (Dillon 87), Smith, Ferry, Weir (Kelbie 80), Davidson (Flood 74), Cook. Subs Not Used: Cleland, McLeish.
Booked: Weir, Smith.
Goals: Davidson 57.
Dumbarton: Grindlay, Nugent, McNiff, Gilhaney, Creaney, Graham (Mptata 72), Lithgow, Nicoll (Wallace 55), Walker (Dargo 60), Prunty, Agnew. Subs Not Used: Gastal, Kennedy.
Goals: Jacobs 78 og, Dargo 90.
Referee: Frank McDermott