West Ham ended a run of five straight Barclays Premier League away defeats as Jack Collison's strike secured them all three points at Stoke.
In a first half of few chances, Hammers defender James Collins' header clipped the bar before Collison netted in stoppage time, finishing on the turn after collecting a through-ball from his fellow substitute Ricardo Vaz Te.
It proved to be the winner, with Potters substitute Charlie Adam going close in added time at the end of the game by cracking a volley against the bar.
The hosts' protests that Guy Demel had handled in the area were then waved away by referee Jonathan Moss.
The result - only the second home league loss for Stoke this season - saw West Ham move up to 12th, level on points with the Staffordshire side, who are now 11th.
The Hammers made a less than ideal start to the match, having to make two substitutions within the opening 11 minutes.
Matt Taylor took a boot in the face as Peter Crouch attempted an overhead kick and was down for some time before heading down the tunnel in the 10th minute, with Collison coming on in his place.
Moments later Joe Cole was also departing the field having picked up an injury, the midfielder being replaced by Vaz Te.
The contest was struggling to spark into life, with Andy Carroll seeing a shot deflected and the ball cleared away, and Crouch sending a tame effort bouncing through to Jussi Jaaskelainen at the other end.
Soon after, Steven Nzonzi, wearing a protective mask after breaking his nose at Fulham last weekend, was caught in the face by Carroll's arm as the pair jumped together for a header.
Nzonzi, who had appeared wound up at Craven Cottage after sustaining the injury from a collision with Dimitar Berbatov, seemed less than impressed once again.
West Ham looked to be responding well following their early disruption and they went close in the 25th minute as Collins looped a flicked header on to the bar.
Collison then unleashed a shot from outside the box straight at Asmir Begovic, before Carroll leapt in front of goal, only to direct his header well wide.
Gary O'Neil was next to complain of being caught in the face, claiming Cameron Jerome had raised his hand to him as the ball went out for a throw-in, but Moss was unmoved.
The Hammers continued to look the more likely to break the deadlock and with seconds of the first half remaining, they managed to do it as their two substitutes combined.
Having attempted to play a one-two with Carroll and had the ball come back to him as the England striker was tackled by Ryan Shawcross, Vaz Te slipped a pass in for Collison, who turned and drilled a shot beyond Begovic.
Stoke appealed for a penalty early in the second half after Jerome went down in the area under the attentions of Joey O'Brien, but Moss waved for play to continue.
Soon after, Matt Jarvis collected another Vaz Te through-ball and saw his shot saved by the legs of Begovic. Crouch then brought a stop out of Jaaskelainen with a low attempt.
Crouch had penalty claims of his own - which replays suggested were somewhat ambitious - ignored, before Stoke boss Tony Pulis looked to shake things up, bringing off Michael Kightly, Jon Walters and Glenn Whelan for Brek Shea, Kenwyne Jones and Adam.
Vaz Te tried to carve out the space to shoot in the box but was unable to do so, and Stoke then almost snatched a dramatic equaliser as Adam rifled a volley against the goalframe in stoppage time.
Even deeper into the additional time, the Potters cried out for a handball against Demel, but Moss said no as West Ham held on.