Rooney was red carded just before the hour mark after a rush of blood saw him kick out at Stewart Downing, but Louis van Gaal’s men held out with teenage defender Paddy McNair impressing on his debut for the club alongside Marcos Rojo.
Rooney had opened the scoring with just five minutes on the clock, applying a superb first-time finish to Rafael’s run and cross down the right to guide the ball across Adrian and into the back of the net.
United made it 2-0 midway through the half, Robin van Persie feinting past Winston Reid before shooting low across goal into the bottom corner from Radamel Falcao’s pass after Alex Song had been robbed of possession in his own half.
But the home side’s frailties returned to haunt them once again as David de Gea came and missed Downing’s corner, allowing Enner Valencia to head against the bar and Diafra Sakho nodded home the rebound.
The home side were sluggish at the start of the second period and were left clinging on after Rooney was rightly dismissed by referee Lee Mason, with McNair producing one excellent defensive header and Kevin Nolan seeing an effort ruled out for offside.
Rooney’s red card is set to rule the United skipper out of the forthcoming games against Everton, West Brom and Chelsea – three games United will want to win to put themselves firmly back in the hunt for the Champions League places.
The desire to put last week’s capitulation at Leicester to bed was clear from the first whistle as United hit West Ham with attack after attack, and it took less than five minutes for the hosts to break the deadlock.
Rafael sprinted down the right flank after dinking the ball over Aaron Cresswell. The Brazilian paused and crossed for Rooney, who fired past Adrian after one bounce.
The expert execution across the West Ham goalkeeper was befitting of a striker whose Premier League scoring record is now only bettered by Andy Cole and Alan Shearer.
United’s creaky defence almost cost them the lead within one minute of Rooney’s goal. Daley Blind’s miscued clearance landed straight into the stride of Valencia, but he blasted into the Stretford End.
It was a let-off for the hosts, who quickly sought to settle the nervy home crowd with a second goal. Rooney found Van Persie at the back post with a delightful cross, but the Dutchman headed wide.
Angel di Maria shot high and wide from inside the West Ham box and Rooney then fluffed a shot inside the area, but Van Persie had no such trouble in the 22nd minute when he put United 2-0 up.
Ander Herrera nicked the ball off Barcelona loanee Song and Van Persie angled his shot past West Ham goalkeeper Adrian after a clever pass from Falcao.
For all their attacking brilliance, at the back United still looked suspect. Song slipped Sakho in behind, but Rojo raced across to put in a vital tackle.
Sakho found the net a few minutes later due to a rare error from De Gea. Valencia hit the bar with a header after the Spaniard flapped at a corner and the ball fell to Sakho, who headed into an empty net.
After the break, West Ham continued to press and aside from a shot by Falcao, United offered little on the attack.
Slack marking from debutant Luke Shaw allowed Sakho to sting De Gea’s palms with a fierce volley.
United looked shaky in the face of West Ham’s attacking play, and their task was made much harder when Rooney was sent off just before the hour.
The United captain, unable to catch Downing, needlessly kicked the midfielder from behind while he was at full pace, earning his first red card for United in five-and-a-half years.
Van Gaal looked to shore up his team by bringing Darren Fletcher on for Falcao after West Ham sent Carlton Cole on and looked to press home their numerical advantage.
Sakho rippled the side-netting and Valencia’s deflected shot flew inches wide as West Ham piled on pressure.
Herrera hobbled off with a back injury before McNair made an outstanding defensive header deep inside the home box.
Nolan turned in Carl Jenkinson’s cross in the 89th minute, but linesman Andrew Garratt flagged for offside and United held on to record the second win of Van Gaal’s tenure.