Curtis Davies scored both Birmingham goals as they eased away from the Championship relegation zone with victory at fellow strugglers Barnsley.
The centre-back nodded in the opener from Robert Hall's cross at the near post but Jonathan Greening fired in a low equaliser from long range.
Barnsley's Craig Davies blasted a second-half penalty over the bar after Steven Caldwell handled the ball.
And Davies made the Tykes pay with another header from a Hall centre.
It was the defender's fourth headed goal in six games and lifted the Blues to 29 points, seven clear of the drop zone, while leaving Barnsley second-bottom with 21 points.
City were indebted to their England keeper Jack Butland early on as the 19-year-old got down low to keep out Stephen Dawson's effort before saving a Marcus Tudgay header.
After Davies and Greening had exchanged goals, Barnsley looked the most likely to score again with Bobby Hassell's 40-yard strike testing Butland.
And the home side were gifted the opportunity to set up their first back-to-back league wins of 2012 when Caldwell was adjudged to have handled.
Barnsley have not recorded successive victories in the league in 2012 and have won just one of their last 13 games
However, Davies made a mess of the spot-kick and Butland then kept out Matty Done's header before Birmingham's Davies won it.
Barnsley manager Keith Hill:
"We would have been 2-1 to the advantage but we've got to accept that he [Craig Davies] has made the wrong decision.
"He's scored penalties for us, important goals and today he's missed a penalty so I accept there are vulnerabilities to everybody.
"We have to take it, don't we? It's a measure of the task that we've got. We look as though we're controlling a football match and maybe shoot ourselves in the foot - not once but twice, three times - the penalty as well, that's football."
Birmingham manager Lee Clark:
"The last two games we've had, the four points we've taken and the manner that we've done it in is great credit to the young boys - that was quite an old team for us now; five teenagers in the starting 11.
"They're producing individual performances and spirited collective performances, which is more important to get us positive results that mean they stay in the side.
"It's up to the young lads who are in the jersey now and if they continue to give me what they're giving us, the lads who are out of the way at the moment, unfortunately for them, have to bide their time."
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.