Two-goal Bobby Linn will grab the headlines but the Blue Toon owed this remarkable victory as much to the goalkeeping skills of veteran Paul Mathers as to the striker's touch in front of goal.
The Sons, on the other hand, will feel that they blew it big time. They took the lead after 12 minutes when Iain Russell picked himself up after being tripped by Jamie Buchan to blast home the resultant spot-kick.
They were two ahead within 90 seconds when Andy Rodgers raced clear to beat Mathers at the second attempt.
It looked at this stage as Peterhead faced the mother of all hidings, but Mathers produced a string of fine saves to keep the home side at bay.
Gradually the visitors settled down a they grabbed a vital lifeline just before the break when captain Keith Gibson netted following a corner.
The second period was evenly balanced with Dumbarton having the edge on chances. However, it was Linn who got on the scoresheet to level things when he took advantage of slack defending to slide the ball under Stephen Grindlay.
Four minutes from time Linn was again in the right place, this time turning home a low cut-back from Graeme Sharp although he was promptly booked for his celebration.
Linn even had time left to try and grab a hat-trick but although his stoppage-time lob beat Grindlay, he was denied by the crossbar.