The odds were firmly stacked against a Pompey side in administration and having sunk to the foot of the Championship following a 10-point penalty, while having to offload their star names to aid their financial predicament.
And the writing appeared on the wall after Nikola Zigic's seventh-minute opener, his 10th of the season, set promotion-chasing Blues on their way to a routine half-time advantage at Fratton Park.
But Portsmouth, winless in nine and having scored just twice in that period, equalised courtesy of Chris Maguire's sweet 54th-minute finish. And from then on there was no looking back for the hosts, who showed tremendous character.
Blues left-back David Murphy was given his marching orders for a second bookable offence and, from the resulting free-kick, David Norris put the hosts ahead despite huge appeals from a swarm of yellow away shirts who claimed handball by the midfielder.
Kelvin Etuhu added a third and fellow substitute Marko Futacs a late fourth to leave Portsmouth just five points from safety, with manager Michael Appleton now hoping no more of his squad leave Fratton Park before the close of the loan window on Thursday.
With both sides unchanged from the weekend it was Birmingham who started on the front foot, and they soon got themselves in front.
Zigic collected the ball on the edge of the penalty area after a one-two with Marlon King and the towering Serbian took a couple of touches before firing left-footed into the bottom corner.
Blues convincingly dominated proceedings over the opening 15 or so minutes, Keith Fahey and Guirane N'Daw in particular taking hold in the middle of the park.
But Pompey gained more of a foothold as the first half wore on, Joel Ward testing Boaz Myhill for the first time with a simple effort.
Zigic's deflected effort was easily collected by Jamie Ashdown before Pompey enjoyed their clearest opening, Maguire inches away from connecting with Luke Varney's delicious cross after he had got away from Curtis Davies.
Maguire made sure he did test Myhill in the 40th minute, the Derby loanee with a well-struck effort from 30 yards which was parried behind.
Ashdown was called upon to produce a great stop minutes after the restart to deny King and the save proved crucial as Pompey quickly levelled.
Greg Halford slid a free-kick into the path of Maguire and he drilled firmly into the bottom corner, leaving an unsighted Myhill with no chance.
The goal filled the hosts with new-found confidence and they were firmly on top when City left-back Murphy was, somewhat harshly, shown a second yellow card for a foul on Maguire.
But Blues' punishment did not end there as, from the resulting free-kick, Halford floated the ball into the area and Norris controlled, turned and fired home - with a host of Blues players racing to referee Brendan Malone complaining Norris had used his hand to bring the ball down.
Etuhu raced clear in the 77th minute and took the ball wide before finding the net to set the home faithful into dreamland.
And they were brought even more welcome joy in injury time as Futacs finished from close range to provide Pompey with their biggest win of the season and equal Birmingham's heaviest defeat.