The Premier League newcomers led 2-0 in west London, but the home side's comeback was sealed with a Paul Hayes goal two minutes before the end.
Kim Bo-kyung put Cardiff ahead 12 minutes in with his second goal in as many pre-seaon games, a header from Craig Noone's cross.
And Kim turned provider two minutes later, unselfishly squaring for Campbell to double the lead.
But on-loan Everton forward Conor McAleny dragged Brentford level with a double, the first curled beyond Joe Lewis just before half-time and the second another smart finish two minutes into the second half.
And Hayes had the final word after a poor Lewis punch presented him with the ball in front of goal.