Having picked up four points from their previous two league outings, Le Havre knew another positive result against second-placed Marseille would boost their hopes of survival.
It was the visitors, however, who started on the front foot, as Amine Gouiri saw a close-range effort blocked and Adrien Rabiot directed a header from Greenwood’s delivery agonisingly against the bar.
Marseille continued to threaten as the first half progressed, with Greenwood twice going close and Rabiot seeing another effort comfortably saved by Mathieu Gorgelin.
The one-way traffic showed no signs of slowing down with half-time looming, but the hosts’ rearguard held firm under pressure to keep the scores level at the break.
Determined to make their pressure count, Roberto De Zerbi’s side finally broke the deadlock in the 56th minute when Pierre-Emile Hojbjerg released Gouiri through on goal, and the Algerian held his nerve to finish beyond Gorgelin for his 12th Ligue strike of the season.
Following chances at either end of the pitch for Issa Soumare and Jonathan Rowe, the game was temporarily interrupted due to clashes between supporters, with play ultimately resuming after a 25-minute delay.
Upon the restart, Le Havre found a leveller within three minutes, as Josue Casimir's inviting delivery was converted by Soumare from 12 yards.
That goal provided Didier Digard’s men with plenty of belief, and they nearly took the lead shortly after, only for Timothee Pembele's strike to be smartly saved by Gerónimo Rulli.
With time ticking into the final quarter-hour, both sides went in pursuit of a winner as Yassine Kechta came close for the hosts with an angled effort that flew narrowly wide.
However, it was Marseille who found the all-important moment of quality in the 86th minute, with Greenwood cutting in off the right and powering a stunning 25-yard strike into the far corner.
Rulli stood firm as Le Havre probed for an equaliser in stoppage time, and Gouiri added a last-gasp third with a clinical finish in the box, sealing UCL football for Les Phoceens and a 10th consecutive head-to-head victory in the process.
Flashscore Man of the Match: Mason Greenwood (Marseille)
