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.