Sheffield Wednesday fell to a seventh straight defeat to pile more pressure on manager Dave Jones.
Wednesday had made the perfect start at Hillsborough with Miguel Llera opening the scoring after just three minutes.
Llera then gave away the 18th-minute penalty for Sam Baldock to level before Gary Madine put the hosts back in front with 11 minutes to go.
But a second Baldock spot kick followed by an Albert Adomah winner with minutes remaining gave The Robins the points.
A final controversy - Madine shooting home but the referee blowing for a foul - simply added to Jones's frustrations.
Wednesday started the fixture brightly, despite their recent fun of poor form, and were ahead inside three minutes.
Chris Lines curled an inviting corner into the six-yard box for Llera to meet the ball with an unstoppable header.
The hosts should have added to their total but squandered chances and Bristol City grabbed an equaliser against the run of play.
Baldock received the ball into his feet in the penalty area, turned Llera and the centre-half brought him down. Referee Andre Mariner pointed to the spot and Baldock calmly sent keeper Chris Kirkland the wrong way.
In the second half both sides - each battling to fight their way clear of the relegation zone - strove for the win, but it was Wednesday who struck first.
Jermaine Johnson broke at pace, his shot was palmed out and Madine slotted home the rebound from eight yards.
The Owls had just over 10 minutes to hold on, but defensive frailties were all too evident and did not go unpunished.
First Llera handled in the area and Baldock converted, then Adomah curled in a superb effort from a free-kick to pour the misery on Wednesday and Jones.
Sheffield Wednesday manager Dave Jones on the incident surrounding Madine's disallowed goal:
"There are things that go against you, I have seen the referee and he says that Llera has pushed him. If he has pushed him, that's the stupidity of it.
"He says he didn't so, if he didn't then the referee has made a decision I have never seen before in football. It was a clear-cut penalty [before Madine's shot for the disallowed goal], but he didn't see it.
"Today was a prime example of, 'When your luck is out, it's out', which is silly because for 84 minutes our luck was in, but it's cost us."
Bristol City manager Derek McInnes talking about the same incident:
"I think the ref has a decision to make on the handball. But he gives a free-kick prior to the ball going in the net, my players have said they heard a whistle before the ball went into the net.
"For me the only thing I have seen is the over-reaction of the centre-back grabbing the referee with both hands, it was over-aggressive. You can't manhandle the referee, he is quite within his rights to give a free-kick, that's a fact.
"Whether Sheffield Wednesday might have had a penalty before that is another matter, but before the shot came in the referee's whistle had clearly gone. The complaint they should have is whether it was a penalty or not, it could have gone either way."