Birmingham moved back into third place as a result of a last-minute winner from Marcelo that gave the Blues a 1-0 win over Gillingham at St Andrews.
Birmingham had laid siege to Gillingham's goal but it appeared as if their biggest crowd of the season, 26,044, would have to be content with a goalless draw.
But a right-wing corner from Martin Grainger looped over to the far post where Marcelo, who replaced Dele Adebola in the 64th minute, headed home from close range.
The goal was a huge relief to a Birmingham side which had swamped Gillingham for the entire game.
Gillingham, unbeaten in their previous five games, appeared to be on course to maintain their recent run until Marcelo's face-saving winner.
It was Birmingham's seventh successive win and was fully deserved on the amount of attacking play they enjoyed throughout the entire 90 minutes.
In the first half Gillingham made their intentions known by dropping a defensive blanket which continually thwarted the Birmingham attack.
Adrian Pennock was Gillingham's stalwart defender in this period, while goalkeeper Vince Bartram again demonstrated that he is one of the best in the First Division.
Two minutes into the second half Bartram was well-beaten by a Martin O'Connor shot but the ball crashed against the bar and back into play.
Birmingham manager Trevor Francis took off two of his strikers, Adebola and Peter Ndlovu and sent on Mark Burchill, Andy Johnson and later Marcelo.
Gallant Gillingham very nearly created an upset in the 74th minute when Paul Shaw was impeded on the edge of the area. Mark Saunders' free-kick was brilliantly parried by Ian Bennett and Shaw put the rebound into the net only to be ruled offside.
The situation called for desperate measures and on this occasion Brazilian striker Marcelo came up with the goods to give Birmingham their win.