Mason Greenwood and Marcus Rashford turned the game in United's favour after Mohamed Salah had put Liverpool ahead in the 18th minute.
Salah's second of a pulsating contest levelled matters once more with Liverpool looking the more likely to prevail thereafter.
However, the introduction of talisman Fernandes proved a masterstroke as he arrowed a low free-kick into the bottom-right corner from the edge of the area to set up a fifth-round tie with West Ham.
Greenwood provided Liverpool with an early warning as to his threat in the 10th minute when he forced Alisson into a near-post save after a long run down the right.
But Salah was clinical in taking Liverpool's first clear-cut opportunity, latching on to a perfectly placed pass from Roberto Firmino and lofting a composed finish over Dean Henderson.
Eight minutes later, United restored parity in sublime fashion, Greenwood controlling Rashford's expertly flighted cross-field ball with his chest before confidently powering beyond Alisson.
United continued in the ascendancy and Paul Pogba headed over from a Luke Shaw corner before clearing the crossbar with a free-kick. Scott McTominay had a goal-bound effort cleared, with Pogba unable to curl inside the right-hand post after great work down the left from Rashford.
Just three minutes into the second half, Greenwood returned the favour for Rashford, playing him in with a wonderful throughball after Liverpool lost possession in midfield, his England colleague making no mistake in calmly sliding United ahead.
Yet its lead lasted only 10 minutes as a sloppy pass from Edinson Cavani was ruthlessly punished. James Milner combined superbly with Firmino, who teed up Salah to fire through the legs of Henderson.
Trent Alexander-Arnold tested Henderson at the near post and it was only the reflexes of the United goalkeeper that prevented Firmino from setting up Salah for his hat-trick following another excellent pass down the right.
But the decisive moment came as Fabinho was adjudged to have fouled Cavani just outside the box and Fernandes took full advantage of the opportunity to score his 16th goal of the season.
Cavani saw a header bounce off the right-hand post late on but his misfortune proved immaterial as United held firm to keep hopes of a league and cup double intact.