Luke Beckett's predatory strike just beyond the hour mark handed basement side Stockport a morale-boosting three points.
And Beckett's seventh goal of the season was no more than the home side deserved as they should have won by three or four.
Stockport, who welcomed back influential skipper Danny Griffin from Northern Ireland duty, should have taken a confidence-boosting lead on 16 minutes when Sean St. Ledger palmed away Warren Feeney's shot inside the box and a spot-kick was awarded.
However, Rickie Lambert struck a miserable effort wide of the left-hand post.
The penalty miss did inject some life into Stockport though, and during the next five minutes Danny Jackman and Beckett both went mighty close to an opener.
Posh responded with a Clive Platt drive which was well saved by Neil Cutler, then Peter Kennedy pounced on a loose ball some 25 yards out before drilling in a low shot which hit the outside of the post.
Lambert almost atoned for his earlier howler when his curling free-kick was only saved at the second attempt by Posh goalkeeper Mark Tyler, but the last word of the first period fell to Posh's livewire front-man Calum Willock who fired an angled shot high and wide.
The second half began with a spectacular Marc Bridge-Wilkinson volley which flashed just wide of the far post for Stockport, and just past the hour Feeney turned inside Simon Rea before curling a shot inches wide.
The deadlock was finally broken by Sammy McIlroy's side on 65 minutes when Feeney and Jackman combined superbly to set up Beckett who couldn't miss from all of six yards.
Beckett could, and should, have increased his own and Stockport's tally late on, but Chris Plummer almost grabbed a late and undeserved equaliser when he flashed a header wide on 82 minutes.