Alexy Bosetti had given Nice a glimmer of hope when he reduced the hosts' advantage after goals from Mbaye Niang and Vitorino Hilton, but Souleymane Camara struck late on to guarantee Montpellier the victory.
© Getty Images
It was the home side who made the better start to the game and dictated the early play with their dominant possession, as David Ospina was forced to push away an Anthony Mounier shot following a lovely counter-attack.
Remy Cabella, who has been the subject of transfer speculation linking him with a move to Newcastle United, had an opportunity at goal after being gifted the ball, but his shot from outside the box lacked power and was easy for Ospina.
Cabella then went on a brilliant solo run, beating four players down the left, before his bobbling cross was blazed over the bar by Mounier.
However, the hosts finally got the lead they deserved just after the half-hour mark. Mounier ran onto a through-ball, before drawing out Ospina and squaring a pass to Niang, who tapped into an empty net.
Niang thought that he had doubled Montpellier's lead immediately after the break, but his rebound goal was disallowed for offside after Ospina had saved from Mounier's low shot from outside the box.
© Getty Images
However, Montpellier did find a second in the 54th minute when Hilton was on hand to convert the ball from close range at the back post after Mounier's corner had been flicked on at the front stick by Daniel Congre.
Nice managed to pull one back with just over 20 minutes left to play when Bosetti ran onto a long ball before poking past Geoffrey Jourdren and into the back of the net.
Despite the goal, Montpellier made sure of the win nine minutes from time. Victor Hugo Montano's mazy run ended with Ospina saving his powerful shot to his left, but then Camara took the rebound on his chest before firing a volley into the far corner to seal all three points.
Montpellier move up to 15th in the table, while Nice remain three points ahead of them in 13th.