The Black Cats ended a run of back-to-back Premier League defeats in style as a 12th-minute strike from Sebastian Larsson and second-half goals from Adam Johnson and James McClean moved them six points clear of the relegation zone.
"I thought we were brilliant from start to finish," said O'Neill. "It was a magnificent effort by the team.
"It was very important for us today. We won some games over Christmas but let it slip against Liverpool.
"We were re-energised. The players had a couple of days off after the Bolton game, and they were full of vitality today.
"We put West Ham on the back foot relatively early in the game through a great goal by Seb Larsson, and that settled us down."
Sunderland's sixth win of the season lifts them to 14th in the Premier League table, but O'Neill says his side have plenty of work to do to preserve their top-flight status.
"There's always pressure," he said. "The win was important for us. I think anybody in the bottom half of the table still has to be looking anxiously over their shoulder.
"But it was an important win for us - I think it's our fourth in seven games in the Premier League and in the context of things, it was good to win."