The Robins led inside two minutes after Chris Martin tapped home from close range after Antoine Semenyo’s cross.
Cardiff created numerous chances to at least grab a point, but could not find a way past the inspired Daniel Bentley.
Bristol City’s rise into the automatic promotion places will last until at least Saturday, while Cardiff are 13th could to sink further at the weekend.
Both sides were looking to build on encouraging wins in midweek, with Cardiff comfortably beating Barnsley to record a first league win of the campaign, while the Robins ended a five-game winless run by beating Huddersfield.
The Severnside derby has produced a good rivalry over the years, with the intense atmosphere this fixture usually produces missed in the Welsh capital, something Bluebirds boss Neil Harris noted in his programme notes.
Harris also said he was keen to see signs of Cardiff building on their midweek success, but they could not have made a worse start as they again conceded first, something they have made an unwelcome habit of doing this term.
This time it took just over 100 seconds for the hosts to fall behind and they again contributed to their own downfall with Joe Bennett conceding the ball cheaply as Callum O’Dowda drove on and Bristol City worked the ball cleverly to Semenyo whose pinpoint cross was turned home by Martin from close range.
The goal was extremely well worked and the visitors continued to see more of the ball in a first half where Cardiff created several chances despite being far from their best.
Goalkeeper Daniel Bentley produced a fingertip save to deny Kieffer Moore’s header from a corner and that set the tone with the Bluebirds bombarding Bristol City with aerial balls that they struggled to deal with.
Cardiff, looking to win back-to-back league games for the first time this season, were restricted to speculative efforts or set-piece chances, with Leandro Bacuna twice trying his luck from range and Harry Wilson firing just over on two occasions.
The best chance of the half was Moore’s header from Cardiff’s seventh corner of the half, but he failed to find the target and then clattered into the post to sum up the Bluebirds’ frustration just before the interval.
The second half saw no change to the pattern of play, forcing Cardiff to introduce Robert Glatzel and switch to a 4-4-2 system, with only Harry Wilson’s firm header forcing Bentley into action.
The visitors knew one counter-attacking goal would likely make the points safe and with Nakhi Wells and Semenyo able to stretch Cardiff with their pace, they always looked a threat with O’Dowda’s shot deflected over the bar on 64 minutes.
Cardiff missed a huge chance to equalise with 20 minutes remaining when Junior Hoilett nodded Wilson’s cross perfectly into Joe Ralls’ path, but he lashed over from 12-yards.
Josh Murphy was also introduced as Cardiff pushed and probed, but Bristol City threw-on an extra defender and sat deep, with Harris’ side lacking the guile to break them down, despite Moore’s 85th-minute header that Bentley gratefully scooped up.
Bacuna lashed wide in stoppage time as Cardiff threw everyone forward, but the Robins held firm to record back-to-back wins at their rivals for the first time since 2002.
Cardiff City manager Neil Harris told BBC Sport Wales:
“I have to be honest and say I’m absolutely gutted. I feel like I have had my wallet pinched out of my pocket. We were by far the better team. We dominated the game, the ball, and had the better chances. We have been punished for one misplaced pass. I feel robbed.
“It’s a game we could have won and should have won. We have got to defend better. It has to change and it can’t keep happening.
“We have created enough chances to win two or three games and we have to find that clinical edge. Some of our football was outstanding and it baffles me how we have not won the game.
“Any sane person who watched that could see it was a very strong and good performance, but people also look at results first and we should have more points.
“Our performances are improving massively and we will pick up results.”
Bristol City head coach Dean Holden said:
“If Neil Harris feels like he’s had his wallet stolen out of his pocket then he must have been watching a different game to me.
“We had to fight for everything and I am so proud of the performance.
“It’s been a brilliant few days and back-to-back wins feels fantastic. You can’t come here and get result like that without a really tight spirit and we had that.
!The biggest thing is all the supporters watching and listening to that will have really enjoyed. The players really felt that support. People are being hit hard by this second lockdown and so to put a smile on people’s faces is great.”