All three goals came in an action-packed final 16 minutes at the Stade Michel d'Ornano, as early-season strugglers Caen frustrated Marcelo Bielsa's high-flyers.
The visitors finally found the breakthrough in the 74th minute when Alaixys Romao headed home Romain Alessandrini's corner at the near post, snatching just his second goal for the club.
Caen thought they had levelled proceedings three minutes later when Damien Silva had a goal ruled out for offside, but the home fans were celebrating with six minutes left on the clock after Yroundu Musavu-King nodded Jean Calve's corner beyond Steve Mandanda.
It proved in vain, though, as Ligue 1's top scorer Gignac popped up with his ninth goal of the season when he lashed home from close range in stoppage time to leave Marseille five points clear at the top and Caen just outside the relegation zone.
Elsewhere on Saturday, wins for Evian and Lorient saw the two move out of Ligue 1's bottom three.
Evian scored three goals in the final half-hour to see off Metz 3-0 at the Parc des Sports, while an own goal from Mathieu Peybernes and a Gilles Sunu strike saw Lorient triumph 2-0 at Bastia, who now drop into the relegation zone.
Lens too fall into the drop zone after they were downed by Paul-Georges Ntep's double in a 2-0 defeat at Rennes, while a 93rd-minute effort from Lloyd Palun rescued a 1-1 draw for Nice at home to Montpellier.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.