Birmingham manager Alex McLeish took plenty of heart from the performance even though he admitted his side were guilty of some poor defending following their 3-2 FA Cup defeat to Bolton.
Chung-Yong Lee came off the bench to head the winner a minute from time after goals from Johan Elmander and Kevin Davies had been cancelled out by Cameron Jerome and Kevin Phillips.
Blues were hit by injuries to seven first-team regulars and in addition Barry Ferguson (leg) and Martin Jiranek (foot) limped off during the game.
McLeish said: "Our lads, despite the problems we had with injuries, put in a magnificent effort.
"You couldn't ask for more in terms of commitment and effort. But we were a bit sloppy with the goals.
"When your back four changes, they may not gel straight away and it was evident with the first and third goals. But overall the performance of the team was a plus."