Arthur Masuaku’s beautifully bizarre 87th winner capped a battling, resilient second-half display from the Hammers, who ended a run of three without a win in stunning style.
This was not Moyes’s West Ham at their absolute best, but his biggest job has been to add steel and resilience to his group and they needed just that to defy the European champions.
The home side showed their threat early on here when they forced mistakes from the Chelsea defence and Jarrod Bowen and Tomas Soucek had good chances to open the scoring but were wide of the mark before Chelsea struck thanks to some sloppy defending at the other end.
Thiago Silva rose unchallenged above Michail Antonio and Craig Dawson to head past Lukasz Fabianski, who got a hand to the ball but could not prevent the Brazilian scoring his second goal of the season.
A Chelsea calamity between Jorginho and Edouard Mendy handed West Ham the chance to level from the penalty spot and Manuel Lanzini duly obliged, though the Hammers were ready to shoot themselves in the foot once more shortly after.
Here the old West Ham would have crumbled.
"It was tough at times, I was really disappointed to lose the second goal just before half time,” said Moyes, who tweaked his midfield at the break and watched them bounce back.
"We got back in the game and we’d lost a player, we had a bad three or four minutes where we couldn’t get things together.
"I thought the resilience of the players [was fantastic]."
Bowen epitomised that character more than anyone in claret and blue. The forward, along with Antonio, chased every loose ball and did not give the Chelsea defence a moment’s rest.
The former Hull man is always a threat but his finishing can be frustrating at times, though there were no complaints ten minutes into the second half when the winger drove a low first-time strike into the far corner after Vladimir Coufal, restored to the starting XI this week, had muscled Marcos Alonso off the ball.
West Ham were level but still had plenty of defending to do. Romelu Lukaku had entered the fray at the break but was well shackled by the home defenders and Rice ahead of them.
Though West Ham, this band of brothers built by Moyes, pulled together and took the lead when it mattered most having twice trailed.
Pablo Fornals had replaced Zouma and brought a new energy to the Hammers, who were racing forward on the break.
Masuaku and Antonio were quick to take a throw-in high on Chelsea’s left and it was from there, shaping to cross, the West Ham wing-back fired a snaking shot in at Mendy’s near post to send a reminder in this race for the top four.
Posting on social media afterwards, Masuaku said: "So, was it a cross or was it shot? Hint: I was as surprised as you."
West Ham were maybe due some luck after wasting a number of chances against Brighton on Wednesday night, but you make your own luck if you battle this hard.
“That is what we are about as a team, the character, the belief,” said Bowen. “We hung in sometimes when it was difficult. We never know when we are beaten, we went behind twice but showed that reaction and a lot better performance.”