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.
Marseille host Bayern Munich in a Champions League quarter-final first leg on Wednesday but had centre back Souleymane Diawara substituted after just six minutes with a sprained right knee.
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.
Goals from Dejan Lovren and Bafetimbi Gomis earned Olympique Lyon a 2-1 home win over Sochaux which moved Remi Garde's side up to fourth on 49 points. Sochaux are 19th on 27 points.
Gael Danic scored a 13th-minute penalty to earn Valenciennes a 1-0 home victory over seventh-placed Stade Rennes, who had defeated their hosts 3-1 on Wednesday in the French Cup quarter-finals.
Valenciennes' win vaulted the northerners up to 11th.
In other results, midtable AS Nancy won 1-0 at Stade Brest and long-time basement side Ajaccio drew 1-1 with Lorient as their surge up the table continued.