Danny Senda’s side took the lead through Fumnaya Shomotun who latched on to a good ball across the pitch before drilling home off the inside of the post.
The hosts pulled a goal back just a minute before the half time break when Theo Archibald connected with Reece Cole’s low cross.
Barnet changed their shape after the break with two substitutions and would re-take the lead on the hour mark.
Mads Bech Sorensen brought down a Barnet attacker in the area, Trialist One stepped up to take and finished low into the bottom corner.
Just a couple of minutes later, Brentford were awarded a penalty of their own. Alan Judge was brought down, dusted himself off to take the penalty and converted past McKenzie-Lyle.
Brentford took the lead for the first time in the 64th minute, McKenzie-Lyle parried Chiedozie Ogbene’s shot but it fell to Marcus Forss to tap home the rebound.
A crazy 5-minute spell culminated with a fourth goal for the hosts. Reece Cole found the top corner with a dipping, long-range effort giving McKenzie-Lyle no chance.
Brentford made it 5-2 in the 75th minute after Ogbene’s effort was adjudged not to have crossed the line, but it fell kindly to Ali Coote to tap home.
Barnet rallied and set up a tense finale at Jersey Road, Trialist Two’s snapshot caught the trialist in the Brentford goal on his heels to make it 5-3.
There was then a fourth for the visiting Bees as Trialist Two doubled his personal tally with a drilled freekick powered through the Brentford wall and into the back of the net.
However, a late equaliser did not arrive and the game finished Brentford B 5-4 Barnet FC Under 23’s.
Barnet: Kai McKenzie-Lyle, Dwight Pascal, Joe Payne, Tin Plavotic, Andre Blackman, Roy Syla, Fuad Sule, Wesley Fonguck, Jack Taylor, Fumnaya Shomotun, Trialist One.
Subs: Trialist Two for Pascal ’45, Trialist Three for Payne ’45, Shane Cojocarel for Sule ’70