Souleymane Diawara netted the winner deep into stoppage-time as Marseille fought back from a goal down to secure a precious victory on the road at Lorient.
Marama Vahirua fired the hosts into the lead from the penalty spot eight minutes into the second half but OM pulled level midway through the half when debutant Jordan Ayew lashed home.
Lorient were good value for at least a point having largely contained their in-form opponents, but home hopes were shattered at the death when Lucho Gonzalez's free-kick was nodded home by Diawara.
The win was Marseille's fourth in five games and elevates them to second place in Ligue 1, six points behind leaders Bordeaux having played one game fewer.
Lorient, meanwhile, are now on a four-game winless run that has seen them drop down in ninth.
Christian Gourcuff's Lorient almost went ahead after 12 minutes but were thwarted by some superb last-ditch defending, Laurent Bonnart making a goalline clearance from Franco Sosa's header which had goalkeeper Steve Mandanda well beaten.
Mandanda looked more assured four minutes later as he solidly blocked from Sosa's firm volley.
Marseille's first effort on target arrived six minutes from half-time but Lorient goalkeeper Fabien Audard was the equal of Bakari Kone's effort from 12 yards, while the home side ended the half in the ascendancy as Kevin Gameiro's close-range header drew another save from Mandanda.
Six minutes after the restart Kone sprung the Lorient back line with a pass to release Lucho but Audard was alert to make a superb save diving to his left.
The breakthrough arrived two minutes later when Gabriel Heinze fouled Morgan Amalfitano in the area. The referee had no hesitation in pointing to the spot and Vahirua was equally decisive from 12 yards, sending the goalkeeper the wrong way.
Ayew, the 18-year-old son of Marseille legend Abedi Pele, was introduced to the action after 53 minutes and needed just five minutes to make an impact on proceedings on his first-team bow.
Kone created the chance with a run and cross from the left wing that found Ayew, and the youngster belied his years with a composed volleyed finish to pull the visitors level.
And the fightback was completed two minutes into the added on time when Lucho delivered a deep set-piece to the far post and Diawara was on hand to snatch all the points for OM.