WATCH MUTV club channel 24/7 on beIN SPORTS CONNECT | 2-week free trial
Just four minutes separated the two efforts from Erik ten Hag's side as first Fernandes levelled the scores with a controversial goal to cancel out Jack Grealish's opener.
There were no arguments about United's winner, however, with Rashford prodding home at close range after Alejandro Garnacho's pass across goal.
The win puts United just a point behind its arch-rival, while handing Arsenal the opportunity to move eight clear with a victory over Tottenham Hotspur on Monday (AEDT).
Ten Hag hails 'huge' Man United spirit after derby turnaround
Guardiola suggests Old Trafford factor in contentious United equaliser
In-form United had the first opportunity after capitalising on a loose Bernardo Silva pass, Christian Eriksen feeding a pass through to Fernandes who dragged an effort wide of the target.
City started poorly with sloppy passes throughout the opening half hour, providing encouragement to the home fans, but United could not profit.
Rashford came closest as he was first denied by Manuel Akanji after rounding Ederson, with the Brazilian goalkeeper then diving at the England star's feet after Eriksen had sent him through on goal.
Pep Guardiola shuffled his deck 11 minutes into the second half, replacing Phil Foden with Grealish, who took just three minutes to make an impact, heading home Kevin de Bruyne's chipped cross at the far post.
United equalised in contentious fashion, Fernandes curling home past Ederson as Rashford, who was in an offside position, ran on to the pass but did not touch the ball, with the initial offside decision being overruled by the video assistant referee (VAR).
There was more drama soon after when Rashford diverted Garnacho's low cross in to put United within touching distance of City in the Premier League standings after a ninth consecutive win in all competitions.