West Ham climbed back into second place in the Championship despite David Murphy's late header earning Birmingham a point.
Sam Allardyce's side took the lead when Carlton Cole latched on to a flick-on from Frederic Piquionne to sprint clear and drive into the corner.
But Birmingham dominated after the break and went close through Nikola Zigic and Marlon King.
The equaliser came when Pablo Ibanez headed across for Murphy to convert.
Both teams fashioned early chances as Chris Burke sent a header off target before Hammers skipper Kevin Nolan narrowly failed to connect with Julien Faubert's low cross.
West Ham went in front after four minutes when Cole took advantage of hesitation from Ibanez before racing clear and firing past Boaz Myhill.
Faubert somehow missed a golden headed opportunity to put the visitors 2-0 ahead midway through the half before Ibanez cleared Piquionne's nodded effort off the line from the resulting corner.
At the other end, Murphy and Keith Fahey forced Robert Green into saves.
There was a frantic start to the second half as Burke curled an effort inches wide before Steven Caldwell and Joey O'Brien made last-ditch tackles at either end.
Birmingham substitute Zigic looped a header on to the roof of the net from Murphy's cross and missed a great chance from close range after James Tomkins's sliced clearance.
The leveller finally arrived nine minutes from time as Murphy converted Burke's corner to delight the home crowd, with Marlon King missing a late chance to snatch all three points.
Birmingham manager Chris Hughton: "Over the 90 minutes it was a fair result. I was pleased we finished so strongly.
"It is very tough when you concede so early in a game particularly against a team as good as West Ham.
"We were indebted to Myhill's save just before half-time which kept us in the game.
"I still felt, even in the first half, when we were not at our best that we could still create opportunities and put them under the pressure."
West Ham manager Sam Allardyce: "It was all about us missing too many chances in the first half. That was our problem.
"Unfortunately we didn't capitalise upon what was a great first half performance.
"Myhill's marvellous save just before the half was a vital turning point and it came back to haunt us.
"Birmingham is a difficult place to come to at any time but I am disappointed we didn't win."