Giroud volleyed in from outside the box on 89 minutes to send Montpellier up to 60 points from 29 games, one ahead of Paris St Germain who host Girondins Bordeaux on Sunday.
Unheralded Montpellier, who have never won the French title and were not expected to mount a challenge this term, created lots of chances but lacked a cutting edge before league top scorer Giroud struck for the 18th time in Ligue 1 this season.
"There is not much to say. A team attacked and the other only defended," coach Rene Girard told Foot+ television.
Olympique Marseille, who had lost their last five league games, could only manage a 1-1 draw at strugglers Nice after Charles Kabore was sent off in first half stoppage-time.
Nice's Fabian Monzon scored from the penalty spot after 76 minutes to cancel out Andre Ayew's opener in the 56th minute.
They are eighth on 40 points while Nice are 18th on 28 points in the 20 team-table, one from safety.
"We stopped the bleeding. We managed a draw under difficult circumstances," coach Didier Deschamps told a news conference.
"We showed heart, courage and fighting spirit."
Eden Hazard, being watched by a host of top European clubs, shone again as he scored a penalty and set up another goal to help third-placed Lille win 3-0 at midtable Evian.
Hazard put the champions ahead on 36 minutes after he was fouled in the box. Dimitri Payet doubled their lead in the 55th minute after a Hazard pass and Benoit Pedretti completed the victory 12 minutes later.
Lille occupy the Champions League playoff round berth on 53 points.
Valenciennes' win vaulted the northerners up to 11th.