Ricardo Vaz Te and Gary O'Neil both scored to help strengthen West Ham's automatic promotion hopes.
Vaz Te broke the deadlock after a goalless first half at London Road when he headed home a Matt Taylor cross.
O'Neil's curling effort from 25 yards sealed an 11th away win for Sam Allardyce's side.
West Ham move one point behind second-placed Reading with seven games remaining, while Peterborough have lost five of their last seven.
The home side started brightly with Paul Taylor's powerful shot rattling the bar.
West Ham struggled for long periods, but were much sharper after the interval, and they took the lead in the 52nd minute when Vaz Te connected with Taylor's cross.
It went from bad to worse for Peterborough six minutes later.
Former Middlesbrough player O'Neil decided to try his luck from 25 yards and, to the delight of West Ham's 5,000 travelling fans, the ball flew past Paul Jones into the net.
West Ham were denied a third when Kevin Nolan hit the woodwork before Peterborough's Lee Frecklington was frustrated by an excellent Rob Green save.
However, the visitors finished strongly with Nolan, Carlton Cole, George McCartney and Vaz Te all going close.
West Ham manager Sam Allardyce on fans' chants criticising their style of play: "The perception of some people is deluded as the facts about my teams clearly speak for themselves.
"It is a tag that has followed me around for a long time and one I'm never going to be able to shift. I can't do anything about that but I can win football matches.
"We have had to overcome home teams playing with a lot of energy in front of full houses throughout this season. We did it again here and once we got the goals, we out-passed and outplayed Peterborough.
"It was a good performance, although not as good as at Burnley on Saturday. We only drew that game though so everyone was miserable whereas they will be happy tonight."
Peterborough manager Darren Ferguson: "We paid the price for not scoring when we were having the better of the game. If George [Boyd] had taken that chance right on the stroke of half-time, I feel sure we would have gone on to win.
"We should have had a penalty just before that and I feel sure it would have been given had it happened in the other area, but the really disappointing thing was the way in which we reacted to going behind.
"Too many players went into their shells and you can't afford to do that against any team, let alone one aiming to return to the Premier League."