Tottenham suffered a first defeat in their new stadium thanks to Michail Antonio’s superb second-half strike for West Ham.
Third-placed Spurs had won all four games since moving into the Tottenham Hotspur Stadium in early April.
But Antonio’s goal in the 67th minute was the first Tottenham had conceded at home in that period, and means they are not yet certain of finishing in the top four in the Premier League.
West Ham’s Fabian Balbuena cleared a Vincent Janssen header off the line in stoppage time.
The win ended a run of four games without victory for West Ham, who remain 11th in the table with two games to play this season.
West Ham finished strongly, with Antonio and defender Issa Diop forcing Tottenham goalkeeper Hugo Lloris into saves in the closing stages.
Spurs looked tired – they were playing their seventh match in April, and face one more when they entertain Ajax in Tuesday’s Champions League semi-final first leg.
Spurs lack spark
Spurs’ prolonged wait to play in their rebuilt home was worth the wait before West Ham’s visit, with three league wins and a 1-0 victory over Manchester City in the first leg of their epic Champions League quarter-final.
But there had been signs of strain when they struggled to overcome relegation-threatened Brighton in their previous match.
Manager Mauricio Pochettino made four changes to the side that played Brighton but, after a good start, his players appeared to run out of steam.
Son Heung-min’s low strike forced West Ham keeper Lucasz Fabianski into a save at his near post, while a Lucas Moura shot zipped across the face of goal before half-time.
Christian Eriksen also forced Fabianski into action, this time with his feet, but West Ham were happy to counter-attack from the outset.
They were the better side after the break, and the game was deep into stoppage time when substitute Janssen almost earned Spurs a point.
Rare road trip joy for Hammers
With just 16 points earned since their league campaign’s halfway point, West Ham’s season was in danger of petering out.
Having earned only one point from their past eight away trips, the signs were not promising.
But, after a first half in which Fabianski was the busier of the two keepers, Manuel Pellegrini’s side looked the likelier to score after half-time.
Marko Arnautovic touched the ball only seven times in the first half, but a superb piece of control to give Ryan Fredericks a shooting chance early on signalled a better second half display from the striker and his team-mates.
Arnautovic set up the game’s decisive moment, chipping the ball from the right into the path of Antonio, who controlled it with his chest before firing past Lloris from a tight angle.
There was also the unlikely sight of Diop’s long gallop through the middle of the pitch for a shot that lacked enough power to worry Lloris.
But there was also excellent work from Balbuena off the line in injury time, and a superb tackle in the area by Fredericks on Ben Davies, to help West Ham earn only their third away win of the season.
More to follow