Hogan tapped in from six yards out when Maxime Colin played the ball across the six-yard box, giving the goal that ultimately gave them the win.
Middlesbrough dominated the second half but didn't' have enough to get past the strong Birmingham defence.
This result means that Birmingham extends the gap between themselves and the relegation zone to seven points, while Middlesbrough missed out on the chance to get into the top six, as they sit in seventh.
Story of the match
Middlesbrough came into this one in seventh place, one point off the play-off places, with a win taking them into the top six. One change from their last league game, Lewis Wing coming in for the injured Marcus Browne, while Jonny Howson made a return from injury with a place on the bench.
Birmingham however found themselves on the other end of the table, sitting in 19th place, four points off the relegation zone, and the returning Aitor Karanka made three changes to try and extend that gap, with Harlee Dean being recalled to the starting lineup after missing the last three games, while Neil Etheridge and Scott Hogan return too. Alen Halilovic also made the squad, starting on the bench, while George Friend starts against the club he spent the last eight years at.
The away side made a positive start, with the movement of Jeremie Bela, Jon Toral, and Scott Hogan already causing problems for the Boro backline.
Fifteen minutes in and there could have been a first red card in the game for Ivan Sanchez, who was lucky to not be sent off after kicking out at Paddy McNair, but the referee did not see it.
But ten minutes later the first clear cut chance turned into a goal, Sanchez picking the ball up on the right-hand side and driving in on his left, leaving space for Colin, who received it from Sanchez and then played it across the six-yard box for Hogan to tap in from close range.
Five minutes later and Middlesbrough thought they had equalised when a corner was whipped to the back post, where Dale Fry headed it back into the box for Sam Morsy to head towards the top left corner, and what looked like a goal to Boro was deemed not one by goal-line technology.
Just before half-time, Middlesbrough nearly equalised again, this time Marcus Tavernier forcing a save from Etheridge as he had to tip over the Boro man's effort from a long-range free-kick.
The home side made a triple substitution at half-time on order to change things up, with Chuba Akpom, Morsy, and Wing all coming off for Djed Spence, Howson, and Britt Assombalonga
The latter made an instant impact, nearly scoring within two minutes of coming on, George Saville with some quick feet on the edge of the area presented Assombalonga with a beautiful chance but he shot wide on his weaker left foot.
Birmingham were struggling to keep hold of the ball in the second half, with Middlesbrough dominating as they tried to get a crucial equaliser. Substitute Duncan Watmore started causing the blues all sorts of problems.
With fifteen minutes to go, Watmore nearly scored, shooting near post on the half-volley but Etheridge made a good reaction save. Lukas Jutkiewicz came on for Birmingham as they looked to hold on to all three points.
Birmingham managed to hold on to get their first win in nine games in all competitions.
Man of the match: Scott Hogan (Birmingham)
Scoring the winning goal, he proved to be a vital change in Karanka's starting lineup.
Well-rested after missing last weekend's FA Cup encounter against Manchester City, his movement proved to be key and his pressing caused the Boro defence a number of problems.