Rochdale's Joe Bunney broke the deadlock, netting from six yards before Nathaniel Mendez-Laing doubled the lead against his old club from close range.
Michael Smith then halved Posh's deficit from 25 yards 10 minutes before half time.
Rochdale's Bunney and Posh's Chris Forrester both saw second-half efforts well saved as the Dale held on.
The result ends Peterborough's play-off hopes, with Posh sitting 14 points outside the top six, while Rochdale keep their slim play-off hopes alive, with seven points separating them and the top six.
Rochdale Manager Keith Hill told BBC Radio Manchester:
Media playback is not supported on this device
"We're still chasing the dream, it's a massive dream but the players have stood up to the challenge.
"The recent form is absolutely superb and I'm really pleased with today's performance.
"Our attitude, our grit, our determination in the second half to keep the second half clean sheet was magnificent."
Peterborough were narrowly beaten by Rochdale as all three goals came in the first half at the ABAX Stadium.