UEFA Champions League Group E wrap: Chelsea edge Shakhtar in thriller
The former Wigan striker rose high in the last minute of added time to head home Juan Mata's corner after a thrilling encounter in which they twice took the lead but made poor defensive errors as they were pegged back by the swift attacking movement of the Ukrainian champions.
Shakhtar playmaker Willian - a transfer target for Chelsea and Tottenham - twice equalised for the visitors to cancel out Fernando Torres' sixth minute goal and a wonderful 45-yard strike from Oscar.
But Moses had the last say with a goal that leaves Chelsea alongside Shakhtar on seven points in Group E, a step closer to the knockout stages with two games to play, at home to Nordsjaelland and away to Juventus.
It was a victory Chelsea did not deserve against a lively, creative Shakhtar side that continually took advantage of the hosts' sloppy defending, which will prompt questions over whether manager Roberto Di Matteo should have recalled captain John Terry to the side.
Given the rarity of goals for Torres in his Chelsea career, the Spaniard would have been more than grateful for the gift that opened the scoring in the sixth minute.
Shakhtar goalkeeper Andriy Pyatov received an underhit backpass from Yaroslav Rakitiskiy, but Torres read the clearance and opportunistically stuck out a leg for the ball to ricochet straight into the back of the net.
Three minutes later, however, the visitors were level as Willian scored his first of the night. Fernandinho burst past Chelsea defenders into the right side of the penalty area and cut the ball back for his fellow Brazilian to slot through a crowd of bodies, with Petr Cech diving the wrong way.
The game then settled down but never lost its ebb and flow as both sides continually created chances. Torres could only find the side netting from a tight angle before Alex Teixeira zipped an effort just wide of the post following a flowing Shakhtar move.
Five minutes before the break, Chelsea once again took the lead thanks to a wonderful strike from Oscar and another woeful clearance by Pyatov.
The Shakhtar goalkeeper rushed off his line to clear Mata's through ball with his head, only for the ball to fall to Oscar. The Brazilian playmaker still had so much to do but he made it look effortless, controlling with his chest before pinging his finish into an empty net from 45 yards.
The fluid, end-to-end pattern continued after the break and Willian again levelled the score in the 47th minute as he poked in Dario Srna's cross to finish a wonderful Shakhtar move.
The Ukrainian champions - who came into the game having won 17 out of 18 fixtures in all competitions this season - nearly took the lead seven minutes later but Razvan Rat saw his swerving strike from 30 yards rattle the post.
At the other end, Chelsea had a huge shout for a penalty when Ramires appeared to be brought down in the area by Srna as he shaped to shoot, only for referee Carlos Velasco Carballo to wave away the appeals to the home players' astonishment.
Then, with the last touch of added time, Moses rose in the box to head home Mata's corner to send Stamford Bridge into delirium.
In the group's other clash, Juventus cruised to a 4-0 win over Danish side FC Nordsjaelland in Torino.
Claudio Marchisio opened the scoring six minutes in before Arturo Vidal doubled the hosts' advantage midway through the first half.
Sebastian Giovinco added a third before the break to make sure of the points, while Fabio Quagliarella put the finishing touches on a fine performance as the Italian side ended their record run of nine European draws with a thoroughly deserved victory.
The Serie A leaders now trail leaders Chelsea and Shakhtar by just one point with two matches remaining in the group stage.