Peter Whittingham's seventh goal of the season was enough to down Brentford as Cardiff won 2-1 in this Sky Bet Championship mid-table clash.
Second-half goals from Whittingham and Sean Morrison cancelled out Sergi Canos' opener.
The result ended Brentford's hopes of winning four successive Championship games for the first time since October 2015, while Cardiff secured back-to-back home wins.
Both teams have very little to play for with the season coming to an end, but put on a good showing in Wales.
Cardiff boss Neil Warnock made six changes from the team that drew with Barnsley in mid-week, opting for a more attacking shape.
And it nearly paid dividends early on when a one-two between Junior Hoilett and Kenneth Zohore resulted in the former QPR winger angling his shot wide.
Brentford started to grow into the game and red-hot striker Lasse Vibe showed clear frustration after failing to control Josh Clarke's lofted pass, which would have put the Dane through on goal.
It was then Cardiff's turn to threaten when Aron Gunnarsson's 20-yard strike stung Daniel Bentley's palms, before Kadeem Harris' tame effort was held by the Bees goalkeeper.
And the Bluebirds should have taken the lead on 23 minutes when Joe Bennett's cut-back found Hoilett, who blazed the ball over with the goal at his mercy.
Brentford turned on the style as the first-half wore on as a string of passes on the edge of Cardiff's box ended with Jota's deflected shot tricking just wide.
And moments before going in front, Allan McGregor's point-blank save somehow kept out Yoann Barbet's bullet header.
But Dean Smith's men took a deserved lead in the 42nd minute when Konstantin Kerschbaumer's clever back-heel found Canos whose low drive beat McGregor.
The Spaniard has really shone since rejoining Brentford for a club-record fee, believed to be in the region of B#2.5million, in January
It was the 20-year-old's fourth goal in as many games.
All of Brentford's dominance in the latter stages of the first-half was undone shortly after the break when Morrison drew Cardiff level
The Bluebirds skipper rose highest to head home Whittingham's corner in the 47th minute.
Bentley had to be at his best to stop a rampant Cardiff when he saved headers from Hoilett and Morrison in quick succession.
In a second-half where chances were limited, Whittingham hit the winner in the 76th minute after connecting well with Zohore's knock-down.
Cardiff restricted Brentford's attacking flow in the second-half, but they had Jazz Richards to thank when his sliding tackle stopped Alan McCormack from bearing down on goal late on.
Source : PA