Match ends, Sunderland 1, West Ham United 2.
Sunderland remain four points from safety after their second-half rally fell short of overhauling West Ham.
Andy Carroll put the visitors ahead with an early header and provided the lay-off for Mohamed Diame to double the lead after the break.
But substitute Adam Johnson's arrival revived Sunderland and the winger curled home to give the hosts hope.
Fabio Borini slashed wide and Ignacio Scocco headed over, but Sunderland failed to force a second.
While Sunderland have played fewer games than all of the other teams in the relegation battle, their next four matches are against sides in the top six and time appears to be running out for them.
The decision to sack head coach Paolo Di Canio five games into the season was supposed to prevent such a desperate situation. But the gap between the Black Cats and a position of safety has increased from three points to four since Di Canio's exit in September.
Successor Gus Poyet will face questions over his failure to include the influential Johnson in his starting line-up, but Sam Allardyce's more direct style, criticised by some of West Ham's fans after the win over Hull, was partially vindicated by their two goals.
Despite Sunderland playing with three central defenders, Carroll was a constant threat and the former Liverpool striker jumped above John O'Shea and Wes Brown to power home a far-post header after nine minutes.
Sunderland's start to the game had been full of the urgency required in a relegation battle.
Phil Bardsley, making inroads down the right, had threatened before the opener and Lee Cattermole squandered a fine chance to level with a tame shot into the shins of keeper Adrian.
But they could not sustain that momentum and, with attacks regularly floundering around Connor Wickham and an appeal for a handball by Kevin Nolan in the box turned down, sections of the Sunderland fans grew uneasy, jeering as referee Howard Webb blew up for half-time.
Their side emerged re-energised, but once again their efforts were undermined by West Ham's penalty-box bombardment.
Carroll's physical presence proved decisive, as he outmuscled Brown to provide the knockdown from which Diame's shot skidded in off the sole of a defender's boot.
Stewart Downing would surely have buried Sunderland's hopes had he converted after scampering in behind Marcos Alonso, but Poyet's introduction of Johnson spurred his side on.
The former Manchester City man's direct runs pulled West Ham out of position and from fellow substitute Craig Gardner's neat through-ball, he swept in a precise finish to trigger a siege on the visiting goal.
Wickham blasted a rebound straight at Adrian, Borini's rising shot ruffled the outside of the netting and Scocco steered a cross over from 10 yards as the equaliser remained elusive.
Sunderland goalkeeper Vito Mannone was even recruited to the attack for a couple of corners during five minutes of injury-time, but West Ham held out to increase the gloom on a misty Wearside.
Sunderland manager Gus Poyet:
"We are not going to give up, we have shown tonight that we will not give up.
"If I see a team out there not trying and not putting effort in I will leave straight away, I did not see that and we will continue fighting."
Asked if he made a selection error by leaving influential substitute Adam Johnson out of the starting XI, he added: "I need to analyse if I have picked the right team, but we played very well tonight. Everybody would agree we were the better team but we lost and that is the most important thing.
"I'm trying to use Adam Johnson in the best way we can and the more space there is the more influential he will be.
"It would be very easy for me to say he will start next Monday against Tottenham but I don't know."
West Ham manager Sam Allardyce: "When they scored it lifted Sunderland and it lifted the atmosphere, so we changed our tactics, we put an extra man in the defence with Roger Johnson and it worked.
"The West Ham fans will have forgotten about the Hull game last week and will go back down the motorway happy tonight.
"This sets us up perfectly for Sunday and what I hope will be a cracker at Upton Park where we face the in-form team in the league in Liverpool.
"If Andy Carroll stays fit from now to the end of the season hopefully he can go to the World Cup.
"He's not match fit at the moment and he isn't as sharp as he could be, so hopefully we'll see more from him in the next few weeks."
- 28AlonsoBooked at 72mins
- 16O'SheaSubstituted forGardnerat 60'minutes
- 33CattermoleSubstituted forJohnsonat 53'minutes
- 4Ki Sung-yuengSubstituted forScoccoat 79'minutes
- 10WickhamBooked at 75mins
- 13AdriánBooked at 90mins
- 3McCartneySubstituted forArmeroat 45'minutes
- 2ReidBooked at 88mins
- 16NobleBooked at 3mins
- 4NolanBooked at 67minsSubstituted forNocerinoat 84'minutes
- 21DiaméSubstituted forJohnsonat 79'minutes
- Howard Webb
- Shots on Target
Second Half ends, Sunderland 1, West Ham United 2.
Attempt missed. Adam Johnson (Sunderland) right footed shot from the left side of the box is close, but misses to the left.
Attempt blocked. Marcos Alonso (Sunderland) left footed shot from outside the box is blocked.
Adrián (West Ham United) is shown the yellow card.
Attempt missed. Ignacio Scocco (Sunderland) header from the centre of the box is high and wide to the left. Assisted by Marcos Alonso with a cross.
Corner, Sunderland. Conceded by Antonio Nocerino.
Attempt blocked. Fabio Borini (Sunderland) right footed shot from outside the box is blocked. Assisted by Marcos Alonso.
Corner, Sunderland. Conceded by James Tomkins.
Delay over. They are ready to continue.
Delay in match Winston Reid (West Ham United) because of an injury.
Winston Reid (West Ham United) is shown the yellow card for a bad foul.
Craig Gardner (Sunderland) wins a free kick in the attacking half.
Foul by Winston Reid (West Ham United).
Attempt missed. Marcos Alonso (Sunderland) left footed shot from outside the box is too high. Assisted by Adam Johnson following a corner.
Corner, Sunderland. Conceded by Matthew Taylor.
Wes Brown (Sunderland) wins a free kick in the defensive half.
Foul by Andy Carroll (West Ham United).
Attempt saved. Fabio Borini (Sunderland) right footed shot from outside the box is saved in the centre of the goal. Assisted by Adam Johnson.
Substitution, West Ham United. Antonio Nocerino replaces Kevin Nolan because of an injury.