The Potters, who had lost their last four Premier League fixtures going into the game, took a deserved first-half lead through Robert Huth and looked home and dry when Ricardo Fuller's delightful effort made it 2-0 in the 71st minute.
But the Blues, as they had on Saturday against West Ham, swiftly erased the two-goal deficit thanks to substitute Keith Fahey and Cameron Jerome to set up a tense finale.
In the end, though, it was the hosts who emerged triumphant 3-2 as Whitehead pounced five minutes from time to secure a vital three points - much to the relief of Pulis.
Asked if he thought his hopes of a win were gone when Birmingham equalised, the manager said: "Yes - when they got the second goal it was very deflating.
"But I thought in the first half, it was as good as we have played, getting the ball wide nice and early, and we caused them lots of problems.
"The big disappointment was that we weren't coming in at half-time more than one goal up.
"We started the second half well and then had a mad 15 minutes where, after Ricardo's fantastic goal, they pressed on and had nothing to lose.
"After the previous 70 minutes, we started to take a step back, and fair play to Birmingham, they kept going and they nearly nicked something.
"But we've got a great group of players who never give up and they are resilient.
"What we needed was a win, which we have got and it has lifted us a little bit."
It was suggested that Whitehead may have handled the ball in the build-up to his goal, but Pulis - who prior to the game had railed against match officials and suggested a radical overhaul of the system by which they are assessed - claimed not to have seen the incident, adding: "I thought (referee) Mark Clattenburg was very good tonight - and if he's missed that, then I'm very pleased!"
Birmingham manager Alex McLeish was unsure whether any infringement had been committed by Whitehead and was more concerned about the way his team failed to prevent the goal.
"It would have been a great point and I thought the way we were going at the time (of the equaliser), the momentum was with us," McLeish said.
"We were right on top at two each, and their third goal was a dog's breakfast of a goal. It was shocking.
"We have lost some uncharacteristic goals this season. The defenders have not been poor individually - we have still defended well and we saw Scott Dann and Roger Johnson battling tonight against two big centre-forwards, a good 50-50 battle.
"But to lose the goal the way we did was soft to say the least.
"I have seen the goal about 10 times and it is difficult to say whether there was a handball.
"But Kenwyne Jones got a touch, then Fuller got a touch.
"It was probably the only time our centre-halves lost out on a ball consecutively in the whole game and then, what happened next was pretty heartbreaking for the Birmingham fans and for the team."