Nine minutes after United’s Pablo Hernandez had hit the crossbar, Maghoma picked up the pieces to the rebound from a stinging drive from Jota to slam the ball home into the roof of the net.
Bottom of the table Birmingham made the brighter start and from a long throw, Sam Gallagher’s close range volley was blocked amid City claims for a penalty for handball.
Jeremie Boga then saw his low shot blocked and United’s first attempt did not arrive until the 20th minute when Kalvin Phillips forced a decent low save from David Stockdale.
Boga then fired another effort wide for Birmingham before Hernandez squandered a golden chance to play in Kemar Roofe on the counter attack with a heavy pass.
But United were then left thankful for a fine tackle from Liam Cooper as Gallagher prepared to shoot following a dangerous cross from Jonathan Grounds on the left flank.
City’s Maghoma then cut inside from the opposite wing and curled an effort wide before Craig Gardner also fired wide from 30 yards out.
Leeds were struggling to get going and Birmingham survived first a floated Hernandez delivery as Stockdale collected with Phillips lurking before a Hernandez free-kick was scrambled clear.
And United then had a very narrow escape in the 40th minute when Maikel Kieftenbeld surged through the midfield and unleashed a piledriver that was deflected just wide.
Hernandez then curled a direct free-kick over the bar shortly before the half-time break.
City then went close thee minutes after the interval when David Davis volleyed just wide after Phillips had blazed a similar attempt off target at the other end.
After Cooper was booked for hauling down Gallagher, Birmingham’s Gardner then wasted a free-kick which curled out of play.
Whites head coach Thomas Christiansen then finally called for the returning Samu Saiz who was brought on for Pawel Cibicki with 35 minutes left.
Mateusz Klich then joined the fray with a rare appearance when coming on for Phillips 14 minutes later.
The introduction of Saiz looked to have worked the oracle when the no 10 played in Hernandez with 16 minutes left but Stockdale produced a magnificent save and the rebound bounced on to the crossbar.
Whites ‘keeper Felix Wiedwald was then required to pull off an equally impressive stop just moments later to keep out a fierce low shot from Davis.
But Wiedwald and Leeds were unable to keep out Birmingham eight minutes later when record signing and substitute Jota created the only goal of the game.
Jota cut inside from the right flank up against Gaetano Berardi and unleashed a stinging low effort which Wiedwald saved but only into the path of Maghoma who slammed the ball into the roof of the net.
Leeds looked to respond but Hernandez fired wide before Saiz went down under a challenge from Grounds but without winning a free-kick.
And Birmingham then survived four minutes of added time without much alarm as United fell to a first defeat since the 4-1 loss at leaders Wolves in November.
Leeds United: Wiedwald, Ayling, Cooper, Jansson, Berardi, Phillips (Klich 68), Shaughnessy, Alioski (Lasogga 85), Hernandez, Cibicki (Saiz 55), Roofe. Subs not used: Lonergan, Anita, Pennington, Grot.
Birmingham City: Stockdale, Colin, Roberts, Dean, Grounds, Gardner, Kieftenbeld, Davis (Ndoye 87), Maghoma (Nsue 88), Boga (Jota 77), Gallagher. Subs not used: Trueman, Morrison, Gleenson, Jutkiewicz.
Referee: Tim Robinson.