Jarrod Bowen, the man-of-the-match, looked to have secured his team a point after winning a penalty – dispatched by Manuel Lanzini – and scoring an excellent goal in the second-half, cancelling out efforts from Thiago Silva and Mason Mount respectively.
However, in the 87 minute, Masuaku caught Edouard Mendy napping at his near post and managed to loop an effort into the back of the net from near the touchline. The goalkeeper got hands to the ball but could only palm it into the top corner, sending West Ham fans into orbit!
It was incredible audacity that was matched by some questionable goalkeeping. Mendy has been a tremendous presence between the sticks for Chelsea but this was a game to forget – at fault for two of the three conceded goals.
Story of the match
David Moyes shifted into a back-three system to match the Blues, bringing Issa Diop in for the injured Aaron Cresswell – with Ben Johnson slotting in as an auxiliary left-wing-back and Vladimir Coufal operating on the other side. Manuel Lanzini also came in for Pablo Fornals.
Thomas Tuchel made a four changes from his team's narrow victory against Watford. In came Reece James, Silva, Jorginho and Hakim Ziyech; Cesar Azpilicueta, Saul Niguez and Christian Pulisic dropped to the bench while Trevor Chalobah missed out entirely with injury.
Chelsea dominated possession in the early stages but West Ham were happy to sit in and hit on the counter-attack.
That burst on the break was in evidence in the opening minutes after Thiago Silva's careless pass released Bowen; the attacker was quickly closed down by Andreas Christensen and his rushed effort whistled wide of the near post.
The hosts had looked compact but, after 25 minutes, they inexplicably allowed Kai Havertz a free header in the centre of goal. However, it was a tame effort from the Chelsea forward and Fabianski easily collected.
It was big let-off for Moyes' men but they didn't learn any lessons quickly because, just a few minutes later, Chelsea took the lead from a very similar situation.
The Hammers would have been kicking themselves but they nearly found an instant response through Coufal.
The defender reacted quickly to a loose-ball after Chelsea failed to clear their lines, smashing a half-volley across Mendy and seemingly into the corner. Remarkably, the goal-scorer Silva was alive to the situation and he managed to make a last-ditch block.
West Ham didn't let up and they soon forced themselves back into the game, but they owe a lot of their equaliser to the antics of the Chelsea goalkeeper.
Mendy took too long to clear his lines and Bowen was onto him in a flash, causing the stopper to inexplicably bring down the attacker down as he tried to engineer a sliding clearance. Penalty to the Hammers!
It was sloppy spot-kick to give away but there was nothing sloppy about Lanzini's technique: powered into the top left-corner with Mendy diving in the opposite direction.
The home faithful were buoyant and the teams looked to be heading into the break with the scores level but they were hit with a late sucker-punch from Mount.
The boyhood Chelsea hero latched onto a diagonal from Ziyech before striking a wonderfully controlled volley past Fabianski at his near post. Sloppy defending again from West Ham, and the goalkeeper will have been disappointed, but it was tremendous technique from Mount.
The second-half started with the visitors on the front foot but the lively Bowen wasn't a fan of that script.
After winning the penalty in the first-half, the former Hull City man waited on the edge of the box in anticipation of the ball. Coufal picked him out with a little tee-up and Bowen found the corner with a venomous low strike from 20-yards. Game on just before the hour mark!
The goal prompted Tuchel into a second change, throwing Callum Hudson-Odoi on for Ziyech, injecting some more pace and trickery into the Chelsea attack.
And the substitute nearly made an instant impact – sliding the ball through to Mount in the box but Mount's shot was too close to the goalkeeper.
Chelsea were piling on the pressure and Moyes decided to alter his team's shape, bringing Pablo Fornals on for Kurt Zouma and switching to a back-four.
But West Ham immediately targeted that side and went agonisingly close to taking the lead.
Michail Antonio had been relatively well contained but the livewire powered into the space behind Antonio Rudiger and Hudson-Odoi before drilling the ball across he six-yard box. Bowen was lurking but he couldn't direct his stretched effort on-target.
At the other end, Jorginho's weak strike seemed to cause Fabianski a little bit of bother, as it came through a rack of bodies, but the Pole managed to flick the ball around the post.
The match looked like it would end with a point-a-piece but then Masuaku took the game by the scruff of the neck in the final few minutes.
The challengers for Europe came out on top against the champions of Europe. What a game of football!