Chris McCann's late goal made it two wins out of two for Burnley caretaker-manager Terry Pashley.
McCann headed home in the sixth minute of stoppage time after Paul Anderson looked to have saved a point for City.
Charlie Austin scored Burnley's first two goals, the second a penalty, to take his season's tally to 18.
Steven Davies equalised the first, but Austin and Martin Paterson made it 3-1 before Sam Baldock netted a penalty to begin the home side's comeback.
Austin's double saw him equal a club record, as he became the first player to score in eight successive Burnley appearances since Ray Pointer in 1958/59.
The striker opened the scoring at Ashton Gate in the ninth minute, latching on to McCann's lofted pass and going round keeper Tom Heaton to score.
But the lead did not last long, as Davies arched a free-kick over the wall and in after he had been fouled by Michael Duff just outside the penalty area.
Davies then fired another free-kick over before Paterson, promoted from the bench when Ross Wallace suffered an injury in the warm-up, turned Austin's deep cross too close to Heaton.
Paterson was a central figure, however, as Burnley struck twice in two minutes around the hour mark to take a 3-1 lead.
First he earned a penalty when his header from a Junior Stanislas cross struck Mark Wilson on the hand, and Austin converted it for his 14th goal in eight matches.
Then Paterson's back-post effort from McCann's cross took a deflection off Richard Foster to leave Heaton helpless.
City were handed a lifeline inside the final quarter of an hour when Duff fouled Stephen McManus from Wilson's corner and Baldock slammed the penalty into the centre of the goal.
Then Albert Adomah fired a free-kick against the underside of the bar to leave Anderson with a simple finish.
But there was still time for McCann to condemn Bristol City to a third straight defeat when he headed home Kieran Trippier's set-piece.
Bristol City manager Derek McInnes:
"We can't defend like that and hope to achieve anything. We couldn't defend a cross into our box at the death which was very disappointing. A number of injuries have left us without much height to defend set-pieces, but we have to do better.
"I should be talking about a storming comeback and giving the lads credit for showing great spirit, but it's hard to do that when you have lost the game.
"We have been put through the mixer tonight and so have our fans. But there is another home game against Hull on Saturday and we have to respond."
Burnley caretaker-manager Terry Pashley on Charlie Austin:
"I've only worked with the lad for a week, but he is a breath of fresh air. Apart from his goals, Charlie is a total team player.
On his own future:
"I don't expect anything except to carry on doing the job the board have asked me to do for as long as they want.
"I am enjoying working with the first team and it's great to be involved in the atmosphere of Championship games. But the board will make the best decision for Burnley."