Harry Kane was Tottenham's saviour once again on a derby day given extra oomph by referee Mike Dean's determination to press the button marked 'maximum controversy'.
Kane struck twice in the final two minutes as West Ham threatened to end the hosts' strangely unimpressive unbeaten start to the Premier League campaign.
Dean - the official on a one-man mission to enforce a crackdown on penalty area grapplers - helped him do it by awarding a spot-kick in stoppage time having previously given West Ham a highly controversial penalty.
And he ended the game with a red card flourish to eject West Ham's Winston Reid from the action, for a clash with Kane.
Tottenham also had another Harry to thank, midfielder Hary Winks, who scored an equaliser on his first Premier League start, cancelling out Michail Antonio's Hammers opener.
But it was Messrs Dean and Kane who ended up deciding the game.
The 20-year-old Winks made an instant impact by latching on to a clearance but could not hit the target. Christian Eriksen found the net from Spurs' next attack but a raised flag correctly ruled that out.
West Ham counter attacked through Antonio on the right flank. The England fringe man fired once chance over before seeing a closer-range effort blocked that led to the opening goal.
Cheikhou Kouyate saw his header thump off the crossbar, Reid sent the rebound goalwards and Antonio was there to nod past Hugo Lloris to add to his impressive collection of headers and celebrate with an elborate 'dab'.
The goal, coming in the 24th minute, sparked a bad-tempered passage that saw Manuel Lanzini booked for upending Danny Rose, Vincent Janssen penalised with only a free-kick for sending Kouyate crashing into water bottles in front of an enraged Bilic, and Mousa Dembele cautioned for barging Sakho over.
The half-time whistle prompted boos from some Spurs fans, frustrated at their favourites having failed to land a shot on target.
West Ham took the game to Spurs from the restart and Jan Vertonghen's penalty area challenge on Dimitri Payet had to be perfect.
It was and Spurs quickly conjured up an equaliser through that man Winks. Janssen is still searching for his first Tottenham goal from open play but claimed an assist as the Dutchman's shot was too hot for Darren Randolph, in for Adrian in the West Ham goal, to do anything bit parry at his near post. The new boy was first to the rebound and despatched it to spark joyous celebrations with his team-mates.
Tottenham were energised and West Ham had Randolph to thank for an excellent save with his foot to keep out Eric Dier's header.
Rose was booked for fouling Antonio, whose revenge on the left-back saw Eriksen fire a free-kick just over.
Then it was the turn of referee Dean to send the game into bonkers mode, pointing to the spot when Reid went down with Janssen's arms all over him. Lanzini made no mistake with the penalty, in the 67th minute, and the Dutchman was immediately replaced by Dele Alli.
West Ham substitute Simone Zaza fired one effort wide and another at Hugo Lloris as the visitors tried to pick Spurs off on the counter attack.
Tottenham were not to be denied however and Kane made it 2-2 with two minutes remaining with a back-post finish after Randolph could only spoon out a cross by Son Heung-Min, the substitute.
Then, in stoppage time, West Ham substitute Havard Nordtveit tangled with Son on the edge of the box and again Dean pointed to the spot, for Kane to win a game that ended with Reid, only just back from a ban, shown a red card for crunching the England man.
Tottenham Hotspur: Lloris; Walker (Trippier 89), Dier, Vertonghen, Rose; Wanyama, Winks, Dembele (Son 72), Kane, Eriksen, Janssen (Alli 68).
Subs not used: Vorm, Onomah, Wimmer, Carter-Vickers.
West Ham United: Randolph; Kouyate, Reid, Ogbonna; Antonio, Lanzini, Obiang, Cresswell, Ayew (Fernandes 61); Payet (Nordtveit 85), Sakho (Zaza 61).
Subs not used: Adrian, Feghouli, Collins, Fletcher.
Referee: M Dean