Thje Blue Toon went in at the break a goal down and could have been further behind but for some fine goalkeeping from Brett Long.
However the visitors turned the game on its head early in the second half with two goals in a three-minute burst which had the hosts in danger of losing their unbeatean record.
But Queen’s came back with two goals of their own to regain the lead before the crossbar denied Derek Lyle a last-gasp leveller for the Balmmor outfit.
With boss Jim McInally serving a touchline ban Peterhead started slowly and Queen’s Park could have been out of sight early on.
Even before Queen’s Park’s fifth minute opener, Long had been called into action to keep out efforts from Grant Gillespie and Michael Doyle while Simon murray headed a good chance over the bar.
But Murray made amends when he coolly slotted past Long to put his side in front.
Liam Brown cracvked a strike off a post as the league leaders continued to dominate and Peterhead may well have been relieved to get to half-time still only one behind.
But within nine minutes of the restart, remarkably, they were in front.
Hamish Ritchie brought them level on 51 minutes, firing home a righht-foot striker after Scott Brown’s shot was deflected into his path.
The hosts were stunned again three minutes later when Derek Lyle – on as a half-time substitute – swpt home Josh Mulligan’s cutback from six yards.
It stayed that way until 14 minutes to go when the the home side turned things back in their favour with their own devastating one-two.
Luca Connell, on loan from Celtic, tied the score at 2-2 with a low strike form the edge of the box after a Doyle cross broke to him off Bob McHugh.
The winner came in the 80th minute as Jack Thomson combined with McHugh before slotting the ball low past Long.
It was a bitter blow for the visitors, but even then they almost snatched a point in the 90th minute when Ryan Conrpy’s free-kick fiound Lyle at the far post but the veteran shot hit a post..