Defeat left Sunderland still searching for their first Premier League win of the seasons after their slow start.
Winston Reid's 94th-minute goal enabled West Ham to grasp a last-gasp 1-0 win over Premier League basement club Sunderland at the London Stadium on Saturday.
Defeat left Sunderland still searching for their first league win of the season.
But it had appeared the northeast club would at least come away with only their third point of the campaign and a first clean sheet after surviving some early pressure from the Hammers.
But in the fourth minute of added-on time all that changed when New Zealand defender Reid shot through a crowded penalty area to give the Hammers just a second win at their new home following the east London club's move from Upton Park.
Former Manchester United manager David Moyes had set Sunderland up to defend and they all but invited the Hammers to attack them.
As a result, the hosts created several chances early on, Simone Zaza going close with two headers before playmaker Dimitri Payet curled a shot just wide.
The Frenchman then evaded several Sunderland defenders obnly to be denied by a good save from Black Cats goalkeeper Jordan Pickford.
Zaxa then played in Manuel Lanzini but Lamine Kone, covering back, blocked the Italy striker's effort.
Payet was unlucky not to put the Hammers in front shortly before the half-hour mark when his low shot beat Pickford only to hit the post.
Eventually, Sunderland created chance of their own as former Hammers striker Jermain Defoe gave Adrian his first save of the match.
Zaza, on the stoke of half-time, managed an acrobatic overhead kick following John O'Shea's half-clearance but the shot flew well wide of Pickford's goal.
Despite a largely one-sided opening 45 minutes, Sunderland had an excellent chance to break the deadlock early in the second half.
A defensive mix-up left Wahbi Khazri one-one-one with Adrian, but the Spanish keeper was quickly off his line to block.
West Ham continued to have the lion's share of possession without truly testing Pickford and there was frustration for the home side when Hammers substitute Ashley Fletcher made a mess of a return pass following another fine run by Payet.
But just when a draw looked assured, West Ham snatched all three points.
A later corner was played short by Payet and. having received a return pass, he squared the ball to centre-half Reid who, in one stylish movement, turned on the edge of the box and struck a low shot through a crowd of legs and beyond Pickford.