The Hammers were left shell-shocked at the break as they found themselves 3-1 behind.
Jordon Mutch struck first with an impressive solo goal for the visitors, bamboozling Abdoulaye Faye with some trickery before firing a shot past an unsighted Rob Green. And Blues doubled their advantage moments later when Marlon King beat the offside trap before keeping his cool to slot home.
The home supporters were beginning to voice their displeasure before Vaz Te headed in his fourth goal in as many games in first half stoppage time.
However, Birmingham went straight up the other end and restored their two-goal advantage when Chris Burke fired a volley into the ground which somehow bounced into Green’s net.
Carlton Cole pulled one goal back before Vaz Te lashed in the equaliser from the spot which was awarded after Henri Lansbury’s shot hit Burke’s arm.
Pedro stepped off the bench to send Chelsea into the FA Cup semi-finals after they beat Leicester 2-1 at the King Power Stadium on Sunday evening.
RB Leipzig came from behind at the Red Bull Arena to end a run of four winless games and defeat Bundesliga leaders Bayern Munich 2-1 on Sunday.