In the third of six added minutes, Rooney stepped up and blasted the ball past Blades goalkeeper George Long after Memphis Depay went down in the box following a challenge by Dean Hammond.
Rooney and his United team-mates made a habit of scoring late goals for Sir Alex Ferguson and Van Gaal will be happy they still know how to dig themselves out of trouble at the end of matches.
This was not a victory the Red Devils deserved
At times it seemed the home supporters inside Old Trafford were on the verge of an open revolt against their manager
They cheered ironically when Matteo Darmian registered the hosts' first shot on target in the 69th minute and thousands had already streamed out of Old Trafford by the time Rooney had scored from the spot.
The home supporters inside Old Trafford had every right to complain
Once again they did not get value for money from their players or their manager
Far from it
In truth, it was as bad a performance seen here this season
Sheffield United began the day 46 places below the 20-time English champions in the league ladder
They have been beaten by Bury, Crewe and Colchester this season
Last week they lost 3-2 at home to Peterborough.
But the League One side never looked being defeated in this third round tie until Depay went down following an apparent trip by Hammond.
Van Gaal's men mustered just one shot on target in the whole match and they only came to life when their manager brought on Depay and Jesse Lingard with half an hour to go.
Van Gaal had selected a strong line-up containing nine internationals, but they could not muster a single attempt on target in the opening 45 minutes
Rooney plunged a long-range shot into the East Stand and then rounded the goalkeeper after a delicious ball from Darmian, but the Blades' defence regrouped and blocked the striker's path to goal.
A few home fans started urging their team to pass the ball forwards, but their calls fell on deaf ears
It was the same old stuff from Van Gaal's men - sideways pass after sideways pass
Shortly after Daley Blind had ploughed the ball into the stand, the half-time whistle blew and boos reverberated around Old Trafford.
It was the 10th successive home game that Manchester United had failed to score before the break - a damning statistic that demonstrates how boring the football has become at Old Trafford.
It was only when Depay and Lingard came off the bench that the hosts looked threatening.
The Â£25million Dutch winger fired a low shot just wide of Long's goal, causing the home fans to rise to their feet and applaud ironically
Finally they had seen some attacking intent from their team.
And then with 21 minutes left, the hosts managed their first shot on target - a weak effort from Darmian.
The Blades held firm at the back as United launched attack after attack.
D epay came close with a low shot in the final minute, but many home fans were not around to see it
Thousands had already left, disappointed with what they had seen
Those who stayed were relieved to see referee Jon Moss point to the penalty spot after contact between Hammond and Depay
Rooney sent Long the wrong way and put United into the fourth round
Source : PA