Willian opened the scoring from the spot before Tomas Soucek headed home from a corner on the stroke of half-time, having had a seemingly good goal chalked off by VAR from a similar situation.
After the break, Michail Antonio gave the Hammers the lead, before Willian’s fine free-kick had rescued a point for Chelsea.
But minutes before full-time, Yarmolenko cut inside Antonio Rudiger on the counter and won his side three huge points.
After a tepid start, the match came to life just after the half-hour mark. West Ham, under pressure for much of the contest so far, won a corner which Jarrod Bowen delivered, sparking an almighty scramble in the box before Soucek stabbed it home.
As the Hammers celebrated, VAR checked the goal and controversially ruled it out with Antonio lying prone on the floor after a botched attempt at an overhead kick, marginally offside, though not appearing to interfere with play.
READ ALSO
Things went from bad to worse for David Moyes’ side. Within minutes of the restart, Issa Diop felled Christian Pulisic and Willian converted the penalty. But, deep into added time, West Ham got their equaliser in fitting fashion. Again, Bowen’s corner picked out Soucek, who headed home a legitimate goal this time.
Soon after the restart, West Ham were on top, with Bowen driving a low cross to the far post, where Antonio was waiting to make it 2-1.
Willian’s fine free-kick looked to have earned his side a point, but with second-half added time approaching, Antonio broke into the Chelsea half and found the unmarked Yarmolenko, who cut inside Rudiger and finished calmly to give his side a crucial win.
The loss means Chelsea remain fourth, having failed to take advantage of Leicester City’s earlier defeat to Everton, while West Ham are 16th, three points clear of the drop zone.