For an hour the game was a mass of free-kicks but then Nicky Maynard for Bristol outmuscled Jonathan Grounds on the left edge of the box to fire City ahead from 17 yards.
It was a graceful shot which sped past keeper Danny Coyne before settling in the far corner.
A notable goal and the first in the league against Gareth Southgate's side this season, giving added urgency to his search for replacements for Huth and Tuncay, who have gone to Stoke City for a combined £10million.
It had been a bad week for City with two defeats, the second a Carling Cup exit to Carlisle United from League One.
For Maynard, a £2.25million signing from Crewe a year ago, it was his fifth goal of the season and it came minutes after a kick on his right leg had looked like forcing him off.
City were jubilant and looked ready to protect their lead with everything. That all changed when Jeremie Aliadiere, who had come on as a sub, saw his shot handled by Bristol skipper Louis Carey.
It was way out on the edge of the box and looked no danger and referee Russell Booth ignored it.
Protests from the visitors forced him to review this decision and he gave a penalty, which Adam Johnson swept straight down the middle to bring Boro level.
Boro's football had been desperate, but now they too sensed the win but there was a twist to come in added time.
A ball from Paul Hartley fell right for Maynard, who drifted past David Wheater to smash the winner wide of Coyne's left hand.