Daniel Nardiello's fine strike boosted Barnsley's hopes of Championship survival and dealt a serious blow to Birmingham's automatic promotion bid.
Nardiello struck on 52 minutes, cutting in from the left wing and holding off several challenges before striking a delightful shot in off the far post.
Birmingham dominated the second half, with Niclas Bendter hitting the post.
Trouble erupted at full-time as Blues' Neil Danns and Barnsley's Bobby Hassell were sent off for violent conduct.
Barnsley boss Simon Davey explains why he went on to pitch:
"There was an altercation between players but it seemed to be handbags at 10 paces.
"That's why I went on to the pitch to try and calm things down, but no one from our side said anything."
Birmingham manager Steve Bruce:
"I saw their assistant boss wading in, so what's that all about?
"That's going to take the headlines, but I won't make any comment until I've seen the referee's report.
"We'll see the video evidence and go from there over whether to appeal."
Barnsley: Colgan, Hassell, Kay, Nyatanga, Eckersley (Heckingbottom 36), Devaney (McCann 76), Togwell, Howard, Kyel Reid, Nardiello (Rajczi 84), Ferenczi.
Subs Not Used: Lucas, Jones.
Booked: Togwell.
Goals: Nardiello 52.
Birmingham: Doyle, Kelly, N'Gotty (Gray 75), Jaidi, Martin Taylor, Vine (Bendtner 59), Johnson (Danns 71), Muamba, McSheffrey, Campbell, Jerome.
Subs Not Used: Maik Taylor, Nafti.
Att: 15,857
Ref: C Foy (Merseyside).