Stephane Bahoken marked his first start in Ligue 1 with a first-half brace against Montpellier to lift Nice to fifth.
The young striker scored from close range in the 12th minute and again in the 24th as his side bounced back in style from last week's 4-0 defeat to St Etienne.
Montpellier pressed in the second half and hit the woodwork through Younes Belhanda, but the reigning champions could not find a way back into the game.
The St Etienne setback was Nice's first defeat in six games, with 13 points gained over that period, but they had an early scare when John Utaka's drive skimmed the outside of the post.
But the hosts were soon on the front foot and took the lead just three minutes after that chance, when Eric Bautheac dispossessed defender Hilton and broke through before setting up Bahoken to slot home his first senior goal.
And with 24 minutes on the clock, Luigi Bruins' shot after a solo run rebounded off the post to give Bahoken another simple finish.
Hilton compounded his earlier error by deflecting away team-mate Belhanda's goalbound shot as Montpellier failed to cut the arrears by half-time.
They had chances after the interval, with Nice keeper David Ospina saving Belhanda's header and Anthony Mounier's low volley.
Most of the goalmouth action, though, was saved for a frantic last five minutes in which Montpellier threw everything at the home defence.
Souleymane Camara teed up Belhanda to smash a left-foot drive against the crossbar and it set the tone for the game's finale.
Camara himself fired into the side-netting from 20 yards and another clean strike from Belhanda bounced to safety off defender Renato Civelli.
That allowed Nice to hold on for their first win in nine meetings with Montpellier, and they could even have extended their lead in stoppage time when substitute Neal Maupay, on for Bahoken, seized on defensive uncertainty but was denied by keeper Geoffrey Jourdren.