A sublime free-kick by Diego Tristan was enough to push West Ham closer to a Europa Cup slot and inflict on Stoke their first home defeat since Boxing Day.
The Spaniard's first-half strike earned Gianfranco Zola's side a victory they just about deserved despite a barrage of late pressure by their never-say-die opponents.
Former West Ham winger Matthew Etherington was heavily involved with a couple of teasing crosses as Stoke made the early running.
And the home fans were furious in the 11th minute when Ricardo Fuller's close-range strike was ruled out for a foul on Hammers keeper Robert Green.
Green appeared to flap in his efforts to collect a long throw from Rory Delap, but referee Peter Walton gave him the benefit of the doubt.
And there was similar controversy at the other end three minutes later when David Di Michele was penalised for handball before he poked a shot past Thomas Sorensen.
Stoke were still in the ascendancy and Abdoulaye Faye should have done better than balloon his header over the top from a Liam Lawrence corner.
But Faye was at fault when he flattened Di Michele to concede a free-kick which led to West Ham's 33rd-minute winner for 33-year-old Tristan.
Tristan placed the ball 22 yards out and then took full advantage with a magnificent curling shot which flashed high inside Sorensen's right-hand post.
More controversy flared at the end of an entertaining half when Luis Boa Morte went in late on Delap and the Stoke man retaliated. Both were fortunate to escape with yellow cards.
Stoke attempted to up the ante again at the start of the second half, but Matthew Upson and James Tomkins were towers of strength at the heart of the visitors' rearguard.
Radoslav Kovac also hardly misplaced a pass in the centre of the park, helping the Hammers to play some attractive football at times.
Junior Stanislas could have added a second when he fired too high from 16 yards before Stoke boss Tony Pulis made a double substitution in an attempt to stir his troops.
James Beattie, a pre-match doubt with a thigh injury, and Danny Pugh made way for Henri Camara and Seyi Olofinjana.
Stoke almost levelled two minutes later when Faye's header from a Lawrence corner was cleared off the line by Mark Noble.
But Zola's men held firm and Tristan should have extended their lead in stoppage time when he chipped the ball wide after bursting clear.
There was still time for one more effort from Stoke as Fuller shot over the top following a goalmouth scramble.