Preston replaced Swansea City in the final play-off spot after dominating the first half at Oakwell, forward Barkhuizen grabbing a brace either side of Daniel Johnson's strike.
Defeat for the third-bottom Tykes leaves them four points behind Stoke City, which sits directly above the relegation zone.
Ashley Fletcher salvaged a 1-1 draw for Boro after Lukas Jutkiewicz headed Birmingham in front against his former club in the first half.
Lee Camp saved a Paddy McNair penalty before Jutkiewicz nodded in, but Fletcher was on target nine minutes from time for Jonathan Woodgate's side.
There was drama in the closing stages when Jutkiewicz had the ball in the back of the net but the goal was chalked off by referee Andy Woolmer, with Boro winger Marcus Tavernier down injured.
That sparked a touchline melee, resulting in Blues head of performance Sean Rush and Boro assistant Leo Percovich being sent off. A point apiece leaves Boro and Blues 17th and 18th respectively.