Dumbarton 4 Ayr United 5
Relegation-haunted Dumbarton struck four times in the second half but were still left empty-handed as Ayr got the points which ensures their second division survival.
Ayr got off to a flyer when, after five minutes, Ray Logan produced an outrageous flick from close range which sailed over the head of goalkeeper Stephen Grindlay.
Chris Strain headed the second following an Andy Reid cross, and when Jerome Vareille ran clear to round Grindlay and make it three-nil there were only 12 minutes on the clock.
Had they really tried the visitors could have doubled their advantage before half-time but casualness had crept into their game, and Dumbarton were handed a precious lifeline two minutes after the re-start when Andy Rodgers volleyed home from the edge of the box.
That goal looked being being a mere consolation as Ayr restored their advantage six minutes later courtesy of a curling 25-yard free-kick by Kieran McAnespie.
But the Sons had fire in the bellies and Rodgers scrambled home his second, substitute John Gemmell crashed a 30-yard free in off the post before Paul McQuilken incredibly levelled things with a neat turn and finish inside the box.
The Sons were denied, however, when Chris Robertson arrived from the back to thunder a header past Grindlay following a free-kick out on the right.
Dumbarton have now only picked up two points from their last 10 games and, after the midweek visit of champions Gretna, face a relegation decider at Alloa next weekend.