The Hammers suffered what appeared to be a major setback early on in the Barclays Premier League contest at the Britannia Stadium, with the concussed Matt Taylor and Joe Cole, nursing a hamstring problem, having to come off in only the 10th and 11th minutes respectively.
But it was their replacements, Jack Collison and Ricardo Vaz Te, who subsequently combined for what turned out to be a decisive goal in first-half stoppage time, the latter playing a through-ball to the former, who turned and drilled a shot beyond Asmir Begovic.
Reflecting on a win that halted his team's run of five straight away league defeats, Allardyce said: "Our misfortune ended up as our good fortune today [Saturday].
"Our misfortune was Matt Taylor going off with concussion and then straight after that Joe Cole with a hamstring injury.
"But Ricardo Vaz Te's ball to Jack Collison and (the performances of) those two players throughout the game today [Saturday] has helped us win this match.
"We were a little desperate after only a few minutes when we saw two players coming off injured, but by the end of the game we had a well-deserved victory and it just shows the importance of the strength and depth of your squad.
"Two players come on and the team hasn't got any weaker - it stayed strong and continued to probe the Stoke defence, which finally paid off."
West Ham, for whom James Collins had sent a header on to the bar prior to Collison's goal, twice survived scares in stoppage time at the end of the match to hold on for the victory.
First, Stoke substitute Charlie Adam cracked a volley against the bar, and the hosts then had appeals that Hammers defender Guy Demel had handled in the area waved away by referee Jonathan Moss.
Allardyce felt there could have been a spot-kick awarded to his team for a foul on Mohamed Diame in the first half, and said of Moss: "I think because we have had a penalty claim and they have had a penalty claim and the referee doesn't give either of them, it is consistency.
"The difficulty is when you are put under enormous pressure by the fans and everyone around the place - it is difficult for a referee to withstand that pressure.
"If there was going to be a penalty (for Stoke) it was going to be a soft one, and I can see one (that might have been given for West Ham for a foul) on Mohamed Diame that is no worse or better than what they were claiming for.
"I think the referee withstood the enormous crowd pressure to make the right decision."
Stoke manager Tony Pulis, whose side's defeat was only their second at home in the top-flight this term, was convinced the incident involving Demel should have resulted in a penalty, although he seemed more aggrieved about one in the build-up to the goal that featured West Ham striker Andy Carroll and Potters skipper Ryan Shawcross.
Vaz Te was able to slip in his pass to Collison after attempting to play a one-two with Carroll and having the ball come back to him via a coming-together between the England frontman and Shawcross.
Regarding that, Pulis said: "Their goal is really hard to take - Carroll actually pulls Ryan down and we are disappointed with that, and we could have had a penalty in the second half.
"We thought it was a definite handball. But like the offside rules, handball is a very ambiguous topic at the moment.
"They can say it is handball for one thing and not for something else in a similar situation.
"You are hoping that will give you a break, but we didn't get a break today [Saturday]."
The result saw West Ham move up to 12th in the table, level on points with Stoke, who are now 11th.