Bottom side Coventry recorded their first league win in 12 games to leave Bristol City outside the relegation zone on goal difference only.
Albert Adomah, who was influential for the visitors, fired into the side netting and was convinced he deserved a penalty after a Richard Wood challenge.
Carl Baker side-footed wide for Coventry and a well-placed Gary McSheffrey shot over the top.
But substitute Gary Deegan scrambled in the winner from Wood's free-kick.
Coventry are now within three points of Doncaster, who were soundly , and five adrift of 22nd-placed Nottingham Forest, who .
Ghanaian winger Adomah, reportedly targeted by several Premier League clubs, was a frequent threat and started brightly with a jink inside from the right and fizzing left-footed drive that went just the wrong side of the post.
The former Barnet wideman then burst into the Coventry penalty box and was halted by Wood, but referee Phil Gibbs waved away strong appeals for a penalty from the Robins.
Barker then missed a golden opportunity for the Sky Blues, failing to find the target from five yards, while Wood's header was cleared by Cole Skuse.
An errant pass from Skuse was intercepted by Gael Bigirimana, who burst into the area but sent the ball wide.
Chances continued to fly off target at both ends before Wood's free-kick was only partially cleared and substitute Deegan lashed in from 10 yards out, his fourth goal for the Sky Blues.
Coventry manager Andy Thorn: "In the first half, we were really nervous. I only had one striker fit so we had to go that way.
"It did not work particularly well so we changed it and I thought we epitomised the way we have played in many of our games this season. The difference is that today we got the goal.
"We should have had more but I cannot in any way fault the application or the effort. They were terrific."
Bristol City manager Derek McInnes: "We had 26 attempts at goal and to do that you have to play well.
"In terms of performance there was a great deal of good about what we did but it is hard to talk about because the most important thing at the moment is results.
"It is difficult to take because we have come away from here with nothing and we should have won the game."