Sebastian Larsson's seventh goal of the campaign moved Birmingham back to the top of the Championship at rain-lashed St Andrews.
The former Arsenal player struck after 56 minutes to move Steve Bruce's side a point clear of Derby and more importantly four ahead of third-placed West Brom in the race to gain an automatic spot in the Premiership.
The match was never going to be a classic on a difficult pitch but a fourth 1-0 win in the last six games has given Steve Bruce's side a great chance of regaining their top flight place at the first attmept.
Blues midfielder Stephen Clemence revelled in the conditions with a typically combative display.
Birmingham paid £100,000 to relay the surface in early January.
But, lacking in true bounce, it makes constructive passing difficult. On this occasion driving rain added to the problems with surface water forming in some areas.
Cardiff were unfortunate not to be in front after the opening 45 minutes.
Blues central defender Bruno N'Gotty was relieved when he sliced an attempted clearance from Joe Ledley and it flew straight at keeper Colin Doyle.
Doyle failed to hold on to a header from Cardiff skipper Riccardo Scimeca from a Paul Parry centre and the home side failed to clear before 21-goal Michael Chopra volleyed over from a narrow angle.
The former Newcastle striker then looked to have legitimate claims for a penalty when he was clipped by Doyle but referee Keith Friend waved aside Cardiff's appeals.
Chopra was posing a threat and a mistake by Birmingham defender Martin Taylor allowed him a run to the by-line but his low cross just eluded the run of Steven Thompson into the danger area.
Birmingham threatened for the first time after 35 minutes when Fabrice Muamba played the ball into Rowan Vine who turned past Roger Johnson and drilled a 20-yard drive just past the post.
Larsson then had a curling shot deflected just wide after he seized on a pass from Nicklas Bendtner.
There was a brighter start to the second half by Blues with a shot on the turn from McSheffrey flying only a couple of foot wide with Neil Alexander scrambling across his line.
And after 56 minutes former Arsenal player Larsson, who signed a three and a half year contract with Blues in January, broke the deadlock.
Matt Sadler surged into the Cardiff box before sending over a low cross which was deflected by Bendtner into the path of Larsson who made no mistake from close range.
Bendtner had a low drive saved by Alexander and it needed a good tackle by Roger Johnson to halt Muamba's run into the Cardiff area.
But Doyle needed to make a superb save to tip over a volley from Johnson to protect Birmingham's lead.
McSheffrey hit the post after substitute Cameron Jerome's effort had been parried by Alexander.
The Coca-Cola Football League Championship
Teams
Birmingham Doyle, Kelly, N'Gotty, Martin Taylor, Sadler,Larsson, Muamba (Nafti 72), Clemence, McSheffrey,Vine (Jerome 84), Bendtner.
Subs Not Used: Maik Taylor, Gray, Campbell.
Booked: Sadler.
Goals: Larsson 56.
Cardiff Alexander, McNaughton (Gilbert 88), Johnson, Loovens,Whittingham, Parry, Scimeca, McPhail, Ledley, Chopra,Thompson (Green 79).
Subs Not Used: Forde, Walton, Byrne.
Booked: Ledley, Johnson.
Att: 28,223
Ref: K Friend (Leicestershire).