Da Costa (left) and Ba (right) put West Ham on top at half-time
West Ham moved out out of the bottom three and made it two home wins in a week as they capitalised on a poor first-half display by Stoke.
A defensive mix-up allowed Demba Ba an easy opener with Manuel da Costa heading a second before the interval.
Stoke upped their game after the break with substitutes Matthew Etherington and Kenwyne Jones posing more threat.
But they failed to find a way through and Thomas Hitzlsperger sealed the win with a thunderous shot late on.
Stoke went into the game on a run of five successive away Premier League defeats, and made a cautious opening as the home side dominated early possession.
But for all their neat passing and approach work, West Ham created little of note in front of goal, and the first chance of the game fell to the visitors.
Rory Delap crossed from the left wing into the path of Jon Walters at the near post, who flicked the ball up towards the top corner, only for keeper Robert Green to push it behind for a corner.
Belief at West Ham is growing - Grant
The scare seemed to spark the home side into life and on 23 minutes they took the lead, courtesy of some catastrophic defending by Stoke.
Mark Noble sent a speculative ball straight down the middle, into the path of Ba, whose marker Marc Wilson went to clear the ball as goalkeeper Asmir Begovic came out to do the same.
The pair left it to each other, allowing the Senegalese striker to poke the ball into an empty net for his fourth goal in three league starts since joining the Hammers from Hoffenheim.
The home side looked to have the better of the Stoke defence, with both Wilson and Ryan Shawcross booked in the first half hour as they struggled to deal with the pressure - Wilson for hauling Carlton Cole to the ground and Shawcross for a foul on Scott Parker which led to West Ham's second goal.
From the resulting free-kick, Hitzlsperger's ball found da Costa unmarked at the far post and he headed the ball into the net.
Pulis confident players will respond
Both Hitzlsperger and Frederic Piquionne went close to adding a third for West Ham before the break as they continued to keep the visitors on the back foot.
The pressure was maintained after the restart, with James Tomkins heading against the outside of the post, and it was no surprise when Stoke replaced Jermaine Pennant with Etherington in an attempt to liven things up.
The shake-up injected some life attacking purpose into Stoke and Delap went close anyone when he tested Green from distance, but the England keeper blocked his effort and Tomkins mopped up.
More poor defensive communication between Begovic and Shawcross almost let in Cole for a third but the Bosnian keeper did superbly to recover and block the striker's goalbound shot.
Stoke then sent on Ricardo Fuller and Jones, who caused West Ham more problems, when he headed just wide from an Etherington cross.
This seemed to rouse West Ham out of any complacency and Cole came agonisingly close with a shot just wide of the goal before Hitzlsperger smashed the loose ball into the roof of the net after Stoke failed to clear a Piquionne shot.
The visitors did their best to claim a consolation goal but West Ham's defence stood firm to earn a rare clean sheet and back-to-back home Premier League wins for the first time since last April.
West Ham manager Avram Grant:
"It's a happy dressing room, first because we're winning and second because of our belief about our football.
"I'm very pleased with Ba and Hitzlsperger, they are players we wanted to sign - many players are on loan but they belong to us so it's very good.
"Injuries are part of the game but they happened to us from the start [of the season], which is not when we want. When everyone's fit you see big competition and we have momentum."
Stoke manager Tony Pulis:
"We did smashing until the first goal and to concede such a poor goal was disappointing, then two goals in 10 minutes killed the game.
"Matty Etherington gave us a lot more impetus but we needed goal and we didn't get it. Even in our two previous games, we haven't played that badly but we're getting our pant pulled down and our bottoms slapped for every mistake we make."
"We haven't had certain amounts of luck, be it from officials or from players making decisions, but you have to take it on the chin and get on with it and be ready for the next game."
90:00+3:37 The referee blows for the end of the match.
90:00+2:51 The official flags Frederic Piquionne offside. Asmir Begovic takes the free kick.
90:00+2:51 Substitution Daniel Gabbidon on for Scott Parker.
88:25 Corner taken left-footed by Thomas Hitzlsperger from the right by-line, James Tomkins takes a shot. Save by Asmir Begovic.
87:00 Foul by Dean Whitehead on Victor Obinna, free kick awarded. Free kick taken by Thomas Hitzlsperger.
85:43 Substitution Carlton Cole goes off and Victor Obinna comes on.
85:14 Effort on goal by Ricardo Fuller from deep inside the penalty area misses to the right of the target.
82:26 Frederic Piquionne takes a shot. Ryan Shawcross gets a block in.
82:26 GOAL - Thomas Hitzlsperger:West Ham 3 - 0 Stoke Thomas Hitzlsperger gets on the score sheet with a goal from inside the box to the top left corner of the goal. West Ham 3-0
81:01 Substitution Gary O'Neil is brought on as a substitute for Demba Ba.
80:16 Effort from inside the area by Carlton Cole misses to the right of the goal.
Correction - 77:53 Corner from the right by-line taken by Thomas Hitzlsperger, James Tomkins takes a shot. Save by Asmir Begovic.
77:53 Corner taken left-footed by Thomas Hitzlsperger from the right by-line, James Tomkins has a headed effort at goal from close
range which goes wide of the left-hand upright.
75:49 The official flags Carlton Cole offside. Asmir Begovic restarts play with the free kick.
74:06 Matthew Upson concedes a free kick for a foul on Kenwyne Jones. Marc Wilson fires a strike on goal direct from the free kick,
Carlton Cole gets a block in.
73:03 Frederic Piquionne concedes a free kick for a foul on Robert Huth. Asmir Begovic takes the free kick.
72:18 The referee gives a free kick against Dean Whitehead for handball. Frederic Piquionne takes the indirect free kick.
71:31 The referee blows for offside against Carlton Cole. Asmir Begovic takes the free kick.
71:08 Jonathan Walters takes a shot. Save by Robert Green.
69:59 Thomas Hitzlsperger produces a left-footed shot from deep inside the six-yard box which goes wide of the right-hand post.
69:27 Header from close in by Kenwyne Jones misses to the left of the goal.
67:44 Substitution Rory Delap leaves the field to be replaced by Kenwyne Jones.
67:03 Carlton Cole takes a shot. Save by Asmir Begovic. Mark Noble takes a outswinging corner.
65:44 Jonathan Walters is penalised for a handball. Robert Green takes the indirect free kick.
64:33 Substitution John Carew leaves the field to be replaced by Ricardo Fuller.
58:10 Carlton Cole takes a shot. Save by Asmir Begovic. Corner taken right-footed by Mark Noble, Ryan Shawcross manages to make
56:31 Rory Delap takes a shot. Robert Green makes a save.
54:57 The referee blows for offside against Rory Delap. Free kick taken by Robert Green.
53:00 Matthew Etherington takes a inswinging corner to the near post, Demba Ba manages to make a clearance.
50:25 Substitution Matthew Etherington replaces Jermaine Pennant.
48:52 Foul by John Carew on Manuel da Costa, free kick awarded. Scott Parker takes the direct free kick. Free kick awarded for a
foul by Jonathan Walters on Demba Ba. Mark Noble restarts play with the free kick.
47:17 Mark Noble takes a short corner. James Tomkins is caught offside. Asmir Begovic takes the free kick. Unfair challenge on Glenn
Whelan by Frederic Piquionne results in a free kick. Free kick taken by Asmir Begovic.
45:13 The referee penalises Carlton Cole for handball. Asmir Begovic takes the free kick.
45:01 The second half begins.
45:00+2:07 The first half comes to an end.
45:00+1:50 Free kick awarded for an unfair challenge on Ryan Shawcross by Demba Ba. Asmir Begovic takes the free kick.
44:37 Thomas Hitzlsperger takes a shot. Save made by Asmir Begovic. Mark Noble takes a inswinging corner from the left by-line to
the near post, clearance by Glenn Whelan.
43:55 Danny Pugh challenges Frederic Piquionne unfairly and gives away a free kick. Robert Green restarts play with the free kick.
43:55 Booking Danny Pugh is shown a yellow card.
37:42 Free kick awarded for a foul by Jermaine Pennant on Wayne Bridge. Robert Green restarts play with the free kick.
35:32 Free kick awarded for an unfair challenge on Ryan Shawcross by Wayne Bridge. Asmir Begovic takes the free kick.
34:09 Frederic Piquionne has an effort at goal from close in which goes wide right of the goal.
28:52 Free kick awarded for an unfair challenge on Scott Parker by Ryan Shawcross. Assist on the goal came from Thomas Hitzlsperger.
28:52 GOAL - Manuel da Costa:West Ham 2 - 0 Stoke Manuel da Costa grabs a headed goal from inside the area. West Ham 2-0 Stoke.
28:17 Booking Booking for Ryan Shawcross for unsporting behaviour.
26:23 Unfair challenge on Carlton Cole by Marc Wilson results in a free kick. Free kick crossed right-footed by Mark Noble from
left channel, clearance made by Glenn Whelan.
26:23 Booking Marc Wilson is booked.
Correction - 24:43 Danny Pugh gives away a free kick for an unfair challenge on Frederic Piquionne. Thomas Hitzlsperger fires a strike on goal
direct from the free kick, blocked by Dean Whitehead.
24:43 Frederic Piquionne fouled by Danny Pugh, the ref awards a free kick. Thomas Hitzlsperger fires a strike on goal direct from
the free kick, blocked by Dean Whitehead.
21:50 Manuel da Costa challenges John Carew unfairly and gives away a free kick. Free kick taken by Jermaine Pennant.
20:32 Assist by Mark Noble.
20:32 GOAL - Demba Ba:West Ham 1 - 0 Stoke A goal is scored by Demba Ba from close in low into the middle of the goal. West Ham 1-0 Stoke.
17:56 Free kick awarded for a foul by Marc Wilson on Demba Ba. Scott Parker takes the free kick.
17:15 Matthew Upson concedes a free kick for a foul on John Carew. Jermaine Pennant takes the direct free kick.
Correction - 14:54 Demba Ba takes a shot. Glenn Whelan gets a block in. Inswinging corner taken by Thomas Hitzlsperger, save made by Asmir Begovic.
14:54 Demba Ba takes a shot. Blocked by Glenn Whelan. Corner taken left-footed by Thomas Hitzlsperger, save made by Asmir Begovic.
14:11 Ryan Shawcross takes a shot. Robert Green makes a save.
11:59 Jermaine Pennant takes a inswinging corner to the near post, Demba Ba manages to make a clearance.
11:37 Handball by Scott Parker. Indirect free kick taken by Danny Pugh.
10:46 Jonathan Walters takes a shot. Save by Robert Green. Corner taken right-footed by Jermaine Pennant, Frederic Piquionne manages
to make a clearance.
10:00 Handball decision goes against Demba Ba. Asmir Begovic takes the indirect free kick.
7:37 Carlton Cole is caught offside. Marc Wilson takes the free kick.
5:00 Carlton Cole fouled by Ryan Shawcross, the ref awards a free kick. Mark Noble takes the free kick.
3:48 Manuel da Costa challenges John Carew unfairly and gives away a free kick. Free kick taken by Jermaine Pennant.
2:32 James Tomkins challenges John Carew unfairly and gives away a free kick. Marc Wilson restarts play with the free kick.
0:03 Carlton Cole has an effort at goal from outside the penalty box missing to the wide right of the goal.
0:00 The match begins.
Live text and data provided by The Press Association.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.