After a bright start, Birmingham took the lead in the 28th minute when Lukas Jutkiewicz stole in at the back post to steer home Connor Mahoney's deep corner.
Its joy was short-lived, however, as Villa stormed back with two goals in the space of as many minutes soon afterwards.
Jonathan Kodjia pulled them level with a scuffed finish from 10 yards in the 37th minute before Jack Grealish headed home Albert Adomah's cross at the back post.
Tammy Abraham put Villa 3-1 up with a superb penalty after he had been brought down by Michael Morrison six minutes into the second half, but Kristian Pedersen pulled one back for Garry Monk's side with a cool volley after 57 minutes.
Any hopes of a grandstand finish were extinguished in the 76th minute when Alan Hutton added a fourth, the former Tottenham defender producing a surging run and fine finish to seal all three points for Dean Smith's side.