West Ham 2 // Manchester United 4
But the leaders were rewarded for going for broke in the second half, Rooney starting the fightback with just 25 minutes remaining and completing his 14-minute treble from the spot before the substitute Javier Hernandez sealed the points.
"[Dimitar] Berbatov was fantastic for us holding up the ball and making things happen," Rooney told Sky Sports 2.
"The substitutions were good substitutions and they won us the game."
The comeback not only opened up a bigger lead at the top of the table for Sir Alex Ferguson's side but also dropped the Hammers into the bottom three on goal difference.
Ryan Giggs found himself in the unfamiliar position on left-back for the second half, but he was certain the game was not beyond the team.
"In the first half we played some good stuff and gave silly goals away," he said.
"We felt that if we kept going and got a goal we knew we could do it. We don't give up, no matter what the score.
"We were brilliant all over the park but even when he haven't been playing well we have been grinding out results."
With Ferguson banned from the touchline the first chance he got to talk to his players came at half-time, but even at 2-0 Giggs insisted the United boss was not angry with the team.
"He was calm because we were playing well," said Giggs. "We just got into some good areas and the final ball wasn't good enough, we knew the goals would come."
Rooney acknowledged that visiting Upton Park always leads to a hard game and knew how vital his free kick was in the victory.
"It is a difficult place to come, the next goal [at 2-0] was the most important one and we managed to control the game after that," he said.
The United forward also scored his 100th Premier League goal for United as he curled in an effort from just inside the area, before scoring his third from the penalty spot.