James Redman 53rd-minute winner ended Elgin City's 12-game unbeaten home run as Peterhead earned victory at Borough Briggs.
The Black and Whites looked likely to continue their good home form when Mark Nicolson headed home Daniel Moore's corner just 67 seconds into the game.
But the away side drew level seven minutes before half-time, Martin Bavidge applying the finish to Redman's assist.
The Blue Toon went ahead eight minutes into the second half when Bryan Deasley's corner found Redman, who headed his side into the lead.
The midfielder missed the opportunity to score his second moments later, when he shot wide when well-placed.
Substitute Graeme Beveridge had the chance to level the scores late on, but he was unable to beat Paul Jarvie from the edge of the area.
Elgin: Clark, Niven, Duff, Nicolson, Durnan, Cameron (Beveridge 62), Leslie (Wilson 86), MacPhee, Moore, Gunn, Crooks (Millar 62). Subs Not Used: Calder, McMullan.
Booked: Duff, MacPhee, Niven, Clark, Durnan.
Goals: Nicolson 2.
Peterhead: Jarvie, Donald, Tully, Russell Duncan, McBain, Sharp, Strachan, Redman, Deasley, McAllister (Wyness 77), Bavidge (Davidson 86). Subs Not Used: Jellema, Robertson, Webster.
Booked: Strachan, Redman, McAllister, Tully.
Goals: Bavidge 38, Redman 53.
Ref: Colin Steven