Andy Carroll set the Hammers on their way to victory with a powerful header in the ninth minute, and Mohamed Diame added a second early in the second half.
Adam Johnson pulled a goal back for Sunderland but the Hammers held on to move on to 37 points, 11 clear of the relegation zone with just six games to play.
"It got a little nervy towards the end when they got the goal, but it is a fantastic result for us," Allardyce told Sky Sports.
"I thought the lads handled it really well and in this league you have to take your chances when they come.
"All-round, we were defensively solid and it was a good performance on the counter-attack."
Allardyce came under pressure following some poor results early in the season and he is grateful to his bosses for sticking by him through a tough period.
He added: "We have just taken 15 points from eight games and that is a fantastic run at this stage of the season and that is a fantastic run considering where we were, and it has got us out of trouble and into a mid-table position.
"We have just got to strive on and see how many points we can get in the last six games.
"We aren't mathematically safe, but it is going to be very difficult for the bottom three to catch us now and the important thing about today's result was that it was against one of the bottom three, and we have taken three points off them.
"That was how crucial the win was for us, and how disappointing it must have been for Gus (Poyet)."
Allardyce was impressed by the way everyone in his team played but admitted that Carroll was a particular handful and tipped him to make England's World Cup squad.
"Andy gives you an alternative as a player. He is unique in many ways in the Premier League," said Allardyce.
"There aren't too many who can receive a ball or head a ball as well as he can, and the headed goal he scored from that corner, there was nobody going to stop him.
"There is a lot more about him on the deck than people give him credit for. He can move the ball, he's quicker than he looks, and I just think if he can play every game like he did last year, hopefully he will go to the World Cup."