The Premier League leaders looked destined to slide to defeat against the relegation-threatened Hammers after Mark Noble's brace of penalties before the interval.
But the Red Devils roared back after the break with Wayne Rooney hitting a superb 15-minute hat-trick before Javier Hernandez added a late fourth.
And Ferguson told Sky Sports: "We played like champions today, we kept our heads up and didn't lose faith in our ability.
"It's never easy coming here. They are fighting relegation but we had to do our thing.
"We dominated that second half and it was a real championship performance."
He added: "It was eventful. Being two goals down was a travesty in terms of possession and chances created.
"We were under the cosh so I felt we had to go for it. We needed to get something from it."
Victory put United eight points ahead of Arsenal before the Gunners' evening kick-off against Blackburn but Ferguson added: "Arsenal have a game in hand. It could go to goal difference but I somehow don't think so."
The Old Trafford manager insisted Nemanja Vidic's tackle on Carlton Cole which resulted in West Ham's second penalty was outside the box although he conceded the Serb could have been sent off later when he fouled Demba Ba.
"He could have been sent off for the free-kick outside the box and maybe got a lucky break," he said.
"It would have been harsh but he could have been sent off."
Sir Alex Ferguson felt Manchester United displayed the determination of champions against West Ham.
Wayne Rooney inspired a Man Utd comeback at West Ham, Chelsea drew with Stoke and Birmingham climbed out of the bottom three.
Avram Grant insists West Ham will recover from the disappointment of their defeat by Manchester United.
Chelsea boss Carlo Ancelotti refused to rule his side out of the title race despite a 1-1 draw at Stoke.
Wolves boss Mick McCarthy could not hide his frustration at his side's defending in their defeat at Newcastle.