Twice United trailed against a side destined for a quick return to the Championship with Jayden Bogle and Ben Brereton Diaz both on target for the visitors but Fernandes helped avert another damaging result.
He levelled from the penalty spot in the 61st minute after a foul on Harry Maguire, scorer of United's first equaliser.
Fernandes then smacked home a sizzling left-footed shot to edge his side in front before setting up Rasmus Hojlund to finally subdue their battling opponents.
"At the end we came back. We put ourselves in a position where it's tough to win games. But also it shows a bit of character," the Portuguese said.
"We're scoring lots of goals. It's just about that compactness we need to have as a team."
It was another far-from-convincing display from Ten Hag's side who have conceded 50 league goals although victory moved them above Newcastle United into sixth place to keep them in the hunt for a European qualifying spot.
"Many positives today," Ten Hag said. "The resilience to fight back after losing two times. But also there were negatives. We gave it away, it can't happen, unacceptable, we have to learn from this."
While Sheffield United played with plenty of heart and no little skill, time is nearly up for Chris Wilder's side who have only 16 points from 34 games and will be relegated at the weekend if they lose to Newcastle.
United's FA Cup-semi-final win on penalties was dubbed embarrassing in some quarters after squandering a 3-0 lead against second-tier Coventry City and being spared defeat only by a controversially disallowed goal in extra time.
Ten Hag came out fighting this week, branding the criticism disgraceful but the Dutchman appeared to be staring into the abyss as his side again conjured trouble of their own making.
They could and should have been well ahead as chances went begging and Sheffield keeper Wes Foderingham pulled off several great saves, one from Diogo Dalot in the opening minute and another from teenager Kobbie Mainoo.
But United's habit of shooting themselves in the foot returned in the 35th minute as keeper Andre Onana aimed a pass towards Dalot but it was under hit and the alert Bogle ran through to squeeze in a shot.
United were level before halftime as Alejandro Garnacho, one of the shining lights in a poor season, whipped in a low cross that Maguire delicately glanced in with his head.
The second half was only five minutes old when United's defence was breached all too easily again with Ben Osborn cutting back a pass for Brereton Diaz to stab high into the net.
United looked stunned and quite what new technical director Jason Wilcox and head of football operations Dave Brailsford made of it from the directors box one can only imagine.
But United were handed a lifeline when Maguire went down in the box and Fernandes stepped up to send his kick into the corner. Fernandes then showed his class with a superb finish and United could finally breathe easy as Hojlund, who scored the winning penalty on Sunday, steered in Fernandes's pass.
"He is really leading the team. I'm very happy with his performance," a grateful Ten Hag said of his skipper.