Arthur Masuaku's bizarre late strike sent the Blues spinning to a 3-2 defeat at Stratford in a rip-roaring London derby.
Thomas Tuchel's pace setters led twice through a Thiago Silva header and a sublime goal from Mason Mount, but they were pegged back both times by a penalty from Lanzini and Jarrod Bowen's strike.
And with four minutes remaining substitute Masuaku, lurking out on the left wing, swung a speculative effort towards the Chelsea goal which Blues keeper Edouard Mendy pushed inside his own near post.
The Argentina international was making his first Premier League start of the season against the league leaders and duly converted from the spot to give the Hammers an equaliser.
However, despite the well-taken penalty and the understandable reaction of the West Ham fans, eagle-eyed supporters noticed Lanzini went straight over to James.
It's unknown what sparked the reaction from the normally demure midfielder, yet he bumped shoulders with the England international and certainly exchanged cross words.
The Blues had taken a well-deserved lead through Thiago Silva's powerful header from a corner, but were pegged back after giving away the sloppy penalty.
A lax back pass from Jorginho, ranked third in the Ballon d'Or list, put Edouard Mendy under intense pressure from Jarrod Bowen and the shot-stopper had no choice but to bring the Hammers attacker down.
"Yes it was a bad back pass," said Dean Ashton on commentary duty for talkSPORT. "He put the keeper under pressure.
"But there's nothing wrong with kicking it out!
"This obsession with current goalkeepers who can't see the picture of kicking it out under severe pressure.
"He gets his legs in a tangle and it's an awful challenge."
Just moments later Chelsea took the lead again when a sloppy pass from Declan Rice was picked off in midfield by Ruben Loftus-Cheek who fed the ball to Hakim Ziyech.
With plenty of time and runners across the pitch, the former Ajax attacker picked out Mason Mount with a peach of a pass and he duly slammed home an exquisite volley at the near post.
But it was West Ham who struck next in the 55th minute with a fine finish from Bowen, across an unsighted Mendy and into the far corner to equalise again.
An injury to Zouma forced a reshuffle for Moyes, who had started with a back five to match up with Chelsea's, only to run out of defenders.
They reverted to four at the back with midfielder Pablo Fornals joining the action, and Bowen was agonisingly close to putting West Ham ahead when he could not quite get enough on Michail Antonio's ball across goal.
Instead it was the unlikely figure of Masuaku who collected Antonio's header, floated it goalwards and duly inflicted Chelsea's second defeat of the season.