Cardiff City surrendered an early two-goal lead as Paul Hayes scored a late winner to give Brentford a pre-season friendly victory at Griffin Park.
A Kim Bo-Kyung header and a composed finish from Fraizer Campbell put Cardiff two ahead after 15 minutes.
But Conor McAleny scored for the home side before half-time and a second from the Everton loanee made it 2-2.
Hayes scored the late winner after Cardiff goalkeeper Joe Lewis failed to gather a cross.
Cardiff have two home friendlies against Chievo and Athletic Bilbao to follow before their Premier League opener at West Ham on 17 August, and manager Malky Mackay looks to have plenty to work on after a slack performance against League One opposition.
Having already faced teams from the Conference and League Two, Cardiff expected their sternest test of pre-season so far as they faced a Brentford side preparing for their league opener at Port Vale on Saturday.
Two goals inside the opening 15 minutes put the visitors firmly in control but Mackay will have been alarmed at the ease with which Brentford hit back to equalise, before adding the winner two minutes from time.
Brentford: Button, Logan, Dean, O'Connor, Bidwell, Forshaw, McCormack, Saville; Donaldson, Grigg, McAleny
Subs: Bonham, Venta, Pierre, Diagouraga, Reeves, Dallas, Saunders, Fillo, Hayes
Cardiff City: Lewis, Brayford, Hudson, Turner, Taylor; Bo-Kyung, Bellamy, Whittingham, Mutch, Noone, Campbell
Subs: Marshall, Connolly, Mason, McNaughton, Conway, Ralls, Maynard, Nugent, O'Sullivan, John