Brentford continued their superb recent form to make it 15 games unbeaten in all competitions, as Sergi Canos’ hat-trick saw them come from behind to win.
Will Vaulks put Cardiff in front with a stunning lob from inside his own half.
The Bees drew level when Canos produced a wonder strike of his own with a dipping volley from 25 yards.
Canos put Brentford ahead with a fine run and composed finish before his lob squirmed through Alex Smithies, though Vaulks’ second gave Cardiff late hope.
The win sees Brentford remain fourth in the Championship, while Cardiff slip to 12th.
Cardiff knew they were contending with a Brentford squad full of confidence after a slow start to the campaign.
Their revival was underlined by a midweek win over Newcastle United that has Bees fans looking forward to a first EFL Cup semi-final, with a visit to Tottenham Hotspur in January.
The Bees made seven changes from the side who beat Newcastle and four from the side who defeated Reading last weekend, with boss Thomas Frank able to rotate his ranks in the midst a busy festive period.
Cardiff boss Neil Harris has a smaller squad and the Bluebirds made only two changes from the side beaten at Norwich City, with Junior Hoilett and Joe Bennett recalled.
The Bluebirds came into the game with an excellent recent record against the visitors, with Brentford losing five of their past seven visits to Cardiff, having won only two of their past 22 matches in the Welsh capital.
The Bees have, however, enjoyed themselves on Boxing Day far more than the Bluebirds in recent seasons, losing only once in 11 years, while conversely Cardiff have not earned three points on 26 December since beating Crystal Palace back in 2012.
Boxing Day blues for Bluebirds
Cardiff’s dismal recent record on Boxing Day was evident in the first 45 minutes, where they seemed content to merely allow Brentford sterile possession.
The Bees had almost 65% possession in the first period but never looked like breaching Cardiff, with Canos’ wayward volley from a rehearsed corner routine their only effort on goal.
That was one more effort than the Bluebirds managed until first-half stoppage time when Vaulks produced his moment of pure inspiration, spotting David Raya out of his goal and firing the ball over him expertly from inside his own half.
It was a moment of magic completely out of keeping in what had been a first half with chances and moments of quality a real rarity.
However, the second half began in exactly the same fashion as the first half ended, with a remarkable goal.
This time it was Canos who struck, volleying in from 25 yards after his initial shot had rebounded back to him.
It was another stunning goal, with Canos striking the ball from almost behind him as it dropped and producing the perfect amount of dip to beat Smithies in the Cardiff goal.
With the rules now established that only stunning goals would be scored, Ivan Toney – who had scored eight in his past 10 away games – tried to get in on the act, but his overhead kick was tipped over by Smithies.
The Bees were enjoying their best spell of the game and should have gone ahead just past the hour, but Emiliano Marcondes got his body shape all wrong and fired wide.
However, the tide had turned and Canos soon did double his tally, cutting inside two Cardiff defenders and firing past Smithies from just inside the area.
Canos might have completed his hat-trick moments later, but this time fired just over after another powerful run.
The Spaniard did get his third on 73 minutes when his lob seemed to go straight through Smithies, an exclamation mark on an absolutely wonderful performance from the former Liverpool and Norwich winger.
Vaulks might have been sent off for a poor challenge in the second period, but was still on the field to fire home via a deflection off Toney as Brentford failed to clear a Cardiff corner with 15 minutes remaining.
Cardiff had a strong late penalty claim turned down after the Bluebirds felt Robert Glatzel was pushed in the box, while Brentford again came close through Canos in a frantic finish.
Cardiff City manager Neil Harris told BBC Sport Wales:
“For 49 minutes I thought we were excellent.
“I thought our discipline without the ball, game plan was excellent. We contained Brentford, a very good attacking side, to next to nothing.
“We were comfortable in the game, scored a world-class goal from Will Vaulks on the stroke of half-time and started the second half really well, pressed the ball and forced it in good areas.
“And then we throw three goals into our own net in the space of 20 minutes and leave ourselves with a mountain to climb. We have actually thrown three into the goal.
“I am lost for words, really.”
Brentford manager Thomas Frank said:
“We were okay in the first half but then they scored a spectacular goal. After that, we moved up to another level. I didn’t think they had much in the second half apart from set-pieces. They are strong and always good at set-pieces.
“At the start of the second half, we said we are not going to allow ourselves to lose this one.
“I am so pleased for Sergi Canos that he scored a hat-trick.
“The first goal was an incredibly difficult technical skill. The second was another wonder goal, while the third one was maybe a cross but don’t tell anyone.”
- 6VaulksBooked at 55mins
- 27OjoSubstituted forMurphyat 74′minutes
- 23H Wilson
- 33HoilettSubstituted forM Harrisat 68′minutes
- 29M Harris
- 8JensenSubstituted forDasilvaat 90′minutes
- 19MbeumoSubstituted forFosu-Henryat 77′minutes
- 7CanósSubstituted forForssat 90+1′minutes
- 29Bech Sørensen
Match ends, Cardiff City 2, Brentford 3.
Second Half ends, Cardiff City 2, Brentford 3.
Foul by Rico Henry (Brentford).
Harry Wilson (Cardiff City) wins a free kick in the attacking half.
Substitution, Brentford. Marcus Forss replaces Sergi Canós.
Substitution, Brentford. Josh Dasilva replaces Mathias Jensen.
Attempt saved. Sergi Canós (Brentford) right footed shot from outside the box is saved in the bottom left corner. Assisted by Mathias Jensen.
Corner, Brentford. Conceded by Leandro Bacuna.
Henrik Dalsgaard (Brentford) wins a free kick in the defensive half.
Foul by Mark Harris (Cardiff City).
Attempt saved. Sergi Canós (Brentford) left footed shot from outside the box is saved in the bottom right corner. Assisted by Emiliano Marcondes.
Substitution, Brentford. Tariqe Fosu-Henry replaces Bryan Mbeumo.
Goal! Cardiff City 2, Brentford 3. Will Vaulks (Cardiff City) right footed shot from the centre of the box to the bottom right corner. Assisted by Sean Morrison with a headed pass following a corner.
Corner, Cardiff City. Conceded by Henrik Dalsgaard.
Substitution, Cardiff City. Josh Murphy replaces Sheyi Ojo.
Goal! Cardiff City 1, Brentford 3. Sergi Canós (Brentford) right footed shot from the left side of the box to the top right corner. Assisted by Ivan Toney.
Foul by Mathias Jensen (Brentford).
Harry Wilson (Cardiff City) wins a free kick in the defensive half.
Attempt missed. Ivan Toney (Brentford) right footed shot from more than 35 yards is close, but misses the top left corner.
Rico Henry (Brentford) wins a free kick in the defensive half.