Florian Thauvin deservedly put the hosts in front after 36 minutes, before substitute Saber Khelifa sealed their win with the last kick of the game.
Khelifa was only introduced in the 88th minute, but slotted past Geoffrey Jourden in injury time to ensure Marseille moved four points clear of Nantes in fourth place.
Andre-Pierre Gignac almost put Elie Baup's men ahead early on, but Marseille had to wait until nine minutes before the interval to see their pressure pay dividends as Thauvin poked home his fourth goal of the season.
Victor Montano almost drew Montpellier level just before the hour as he almost got on the end of a whipped cross, and Siaka Tiene had a free-kick saved by Steve Mandana soon after.
However, Tunisia international Khelifa had the final say when he scored late on to condemn Montpellier to their sixth Ligue 1 game without a win.
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.