Luis Enrique's side took a deserved lead through Gustavo Cabral in the 28th minute but were pegged back by Youssef El-Arabi before the break.
But just when it looked as though the hosts would earn a point, Fernandez netted his third league goal of the campaign to make it back-to-back La Liga victories for Celta.
Cabral headed the opener after excellent work down the left from Nolito, but El-Arabi nodded in Fran Rico's right-wing corner to level the scores four minutes before the interval.
With time running out, and both sides looking happy with a point, Celta snatched all three through Fernandez.
Substitute Michael Krohn-Delhi's low cross was palmed into the path of the striker and he poked the ball under Roberto from six yards.
The win moves Celta above their opponents in the table and into 11th place in the Spanish top flight.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.