Former Premier League star Mario Balotelli scored twice before the half-hour mark to take comfortable lead but Portuguese Fernandes fired three in 32 minutes to turn it around
Balotelli scored twice but was still upstaged by Manuel Fernandes as Nice let slip a two-goal lead at home.
The former Manchester City star took just four minutes to put the hosts ahead when he fired home with his right foot after a slick pass from Allan Saint-Maximin.
Nemanja Pejcinovic came close to equalising for the Russian side just a minute later.
But it was Balo who put Lucien Favre’s men two in front after Pejcinovic handled in the box 27 minutes in.
The Italy striker slotted his spot kick into the bottom left corner and it looked like the Ligue 1 side had this Europa League last-32 tie in the bag.
However, Lokomotiv were allowed a way back in when 19-year-old centre-half Malang Sarr brought down Aleksey Miranchuk in the penalty area.
Fernandes stayed cool to find the bottom right corner one minute before half-time.
Balotelli continued his assault on the visitors’ goal but their defence stood firm.
The tide truly turned when Nice’s Racine Coly was shown a straight red for bringing down striker Ariclenes da Silva Ferreira.
Fernandes lined up the free-kick from dangerous range and duly found the bottom left corner to level matters.
Stunned, Nice collapsed and Fernandes pounced again just over ten minutes from time.
Anton Miranchuk found the in-form midfielder who found enough space in the box to get a shot away past Walter Daniel Benitez.