Rhys Priestland kicked Cardiff to victory against Dragons in a United Rugby Championship match in which each side had a player sent off.
Dragons fly-half Will Reed missed a 79th-minute penalty to clinch the win.
The first half saw red cards for Dragons lock Joe Davies and Cardiff hooker Liam Belcher.
Priestand's 14-point haul was complemented by a Lloyd Williams try, while Ollie Griffiths and Jack Dixon scored for Dragons.
Davies was sent off by referee Craig Evans in the 16th minute for a dangerous shoulder to the head of prop Rhys Carre.
Just before half-time, Belcher was dismissed on his 50th appearance for a swinging arm tackle on Dragons fly-half Reed, who suffered heartbreak in his second professional start despite again producing an assured display.
Cardiff secured their first away win of the league this season, while Dragons have still not won at Rodney Parade this season with their only victories coming at Connacht and Scarlets.
Dragons' last home win was against Scarlets in the Rainbow Cup in April 2021 and they have not beaten Cardiff since 2015.
It was not a derby classic with Cardiff 13th in the URC table and Dragons two places below them as mistakes and indiscipline dominated proceedings.
Dragons back rowers Ollie Griffiths and Harrison Keddie will have reminded Wales coach Wayne Pivac of their talents before the squad for the summer tour to South Africa is named next week.
Cardiff scrum-half Williams demonstrated his fine form with a man-of-the-match display.
Derby date change
This was the final Welsh derby of the season in the United Rugby Championship, having originally been scheduled for New Year's Day when it was postponed because both regions had a number of Covid-19 cases in their camps.
Hooker Elliot Dee returned as one of three Dragons changes with flanker Ben Fry and centre Dixon starting, while Cardiff named an unchanged side.
Priestland opened the scoring with a penalty before Davies' transgression, although the hosts ensured they levelled the scores with Reed slotting over a penalty.
A mediocre first half was lifted following a clean break from Cardiff wing Owen Lane as he glided outside Dixon and released an inside pass for scrum-half Williams to score.
The numbers were evened up when Belcher was shown his red card. Dragons took advantage immediately with number eight Griffiths charging over from an attacking scrum.
Replacement fly-half Sam Davies converted to ensure it was 10-10 at half-time.
Priestland restored Cardiff's advantage by slotting over his second penalty, but missed two further kicks at goal.
Cabango demonstrated his searing speed with a burst down the left touchline, but the attack fizzled out.
Dragons were more clinical when they created a chance for Dixon to crash over in the right corner for a well-worked try that gave the hosts the lead.
Priestland's kicked two penalties as Cardiff regained the initiative before Reed slotted over a kick to reduce the deficit.
There were late replacement appearances for Cardiff captain Josh Turnbull, who had recovered from a calf problem, and Dragons prop Lloyd Fairbrother, who has missed the last year with an Achilles problem.
There was late confusion as referee Evans penalised Cardiff, but sought to gain the exact mark for Reed's late kick.
It was a favourable position for the Dragons kicker but he was just wide with his effort as Cardiff celebrated beating their closest rivals.
Dragons director of rugby Dean Ryan: "Whatever plan we had went off the table. In the second half there were bits that I liked about us,
"Our attack game was causing all sorts of problems, but we invited Rhys (Priestland) into the game too easily and that was the difference in the end.
"We were down to 14 men for too long and invited them in too easily. We were better today but our discipline keeps undermining some of the good things that we do."
Cardiff director of rugby Dai Young: "There was not much in it. I feel for the youngster (Will Reed) with a kick like that.
"There were a lot of mistakes in the game for both sides and we were pleased to get the win in the end because it's not an easy place to come.
"We have to be a lot better in a lot of areas and we almost did our best to throw it away."
Dragons: J Williams; Dyer, Warren, Dixon, Rosser; Reed, Bertranou; Seiuli, Dee, Doge, J Davies, Carter, Keddie (captain), Fry, Griffiths.
Replacements: Benjamin, Bateman, Fairbrother, Taylor, Basham, R Williams, S Davies, J Lewis.
Cardiff Rugby: Morgan; Lane, Lee-Lo, Llewellyn, Cabango: Priestland, L Williams; Carré, Belcher, Arhip, S Davies, Screech, Botham, Navidi (capt), Ratti.
Replacements: Myhill, Domachowski, Lewis, Turnbull, E Jenkins, Bevan, B Thomas, Grady.
Referee: Craig Evans (WRU)
Assistant referees: Ben Whitehouse & Tom Spurrier (WRU)
TMO: Sean Brickell (WRU)