Goalscoring opportunities fell to both sides in quick succession midway through the first period, with Chris Burke heading off target for Birmingham before David Cotterill blew a chance at the other end.
Doncaster broke the deadlock 10 minutes before half time following a set piece by Cotterill, which was turned into the net at the second attempt by Paul Quinn.
Birmingham drew themselves level shortly before the hour mark courtesy of a neat finish from Macheda, who capitalised on an error from James Husband and tucked the ball into the bottom corner.
The Blues took the lead in the 71st minute through Novak, who latched onto a long goal kick by Randolph and found the bottom corner from outside the box, with Quinn failing to clear on the line.
Macheda sealed the points for them in the 76th minute when he leaped highest in the area to head home Tom Thorpe's free kick.