In a clash of two unbeaten sides, Wrexham took the lead within just three minutes. A corner delivery was not dealt with and Jack Marriott volleyed home via a deflection to give Phil Parkinson's side a dream start.
Birmingham were level in the 21st minute, though, as Jay Stansfield was quickest to react after Arthur Okonkwo parried an effort from outside the box.
As the half wore on, Birmingham appeared to gain more territory, with Wrexham gradually losing their grip on the game.
To make that point, the hosts had the lead in the 50th minute, as Stansfield headed a brilliant cross from Alex Cochrane into the bottom corner.
And on the hour, it was 3-1, thanks to a brilliant long-range curling drive from Tomoki Iwata on his league debut.
Wrexham responded by bringing on Paul Mullin, who sparked a brawl after a clash with Cochrane on the halfway line, in which he appeared to think about biting his opponent.
Krystian Bielik was sent off for Birmingham with five minutes left, as he received a second yellow card, but it did nothing to spark a Wrexham comeback.