The hosts took the lead once in each half, only to be pegged back on both occasions, but Montpellier had no time for a response after Payet struck late on.
In a very open first period, there were chances for both sides as French international trio Andre Ayew, Andre-Pierre Gignac and Mathieu Valbuena all took turns in testing Montpellier keeper Geoffrey Jourdren.
On a night where several Les Bleus World Cup hopefuls impressed, one of them, Valbuena, appeared as though he may have to leave the field on 41 minutes when he received treatment on an injury.
However, he recovered to put Marseille into a 41st-minute advantage when he collected an Ayew pass to lash into the roof of the net from the right side of the penalty box.
Montpellier were level soon after the resumption of play when reported Newcastle United target Cabella struck from 10 yards moments after Mandanda had blocked M'Baye Niang's shot.
The visitors' parity lasted only 10 minutes as Gignac scored his 14th goal of the season to restore Marseille's lead, guiding Brice Dja Djedje's cross beyond Jourdren following a quick Marseille break.
This time a Montpellier response did not seem to be on the cards until they were again the beneficiaries of a rebound, when Cabella's shot was parried into the path of Morgan Sanson on 79 minutes.
It was then Ligue 1's draw specialists who were pushing for a winner as Niang and Hilton had good chances, but Payet suckerpunched them with a 20-yard effort following a pass from Benjamin Mendy.
The result takes Marseille level on points with fifth-placed Lyon, while Montpellier remain 13th in the table.