The Young Bees dominated the home side and took a 3-0 lead into the half-time break through Nathan Young-Coombes' 19th B team goal of the season, as well as Paris Maghoma and Myles Peart-Harris' tap-ins.
Hanwell centre-forward Ogo Obi pulled one back in the 75th minute with an excellent strike that crashed in off the crossbar, but Lewis Gordon secured Brentford's progression with the last kick of the game
Brentford B head coach, Neil MacFarlane, spoke highly of his team's performance after the match.
"Our application to come here, a venue where we've naturally struggled before, I thought we put in a terrific performance from start to finish and they thoroughly deserved to go through to the semi-final."
MacFarlane made the bold decision to start Max Haygarth and Ryan Trevitt as very advanced wing-backs, almost in a 3-2-5 formation with Peart-Harris and Alex Gilbert also positioned high on the pitch, and believes he made the right decision on the night.
"That's the way we play. We're a very attacking side and we've got to find a way to break down opposition and one that will naturally sit in the way Hanwell did.
"We've been here a couple times before and come up against that, and we decided to deploy Max and Ryan as wing-backs but keeping them on the last line.
"I thought it worked really well tonight."
Haygarth, a player more accustomed to a midfield or more offensive position, spoke of his experience as a wing-back and the challenge of playing in an unfamiliar role.
"I'm not used to that position so I thought it was tough, but I've played there a few times recently and I thought I've adapted well.
"It's taken on a bit more of a defensive role but I'm still able to play on the last line and do what I do on that right hand side. It's just getting back defensively I've got to be careful with that.
"I enjoyed playing there and I think I did a decent job."
Since the team's 11-0 thrashing of Broadfields United in the previous round, there has been four high-profile departures in Nathan Shepperd (Dundalk), Joe Adams (Dundalk), Jan Žambůrek (Viborg), and Lachlan Brook (Adelaide United, loan).
MacFarlane concedes that as characters the quartet will be missed but as the B team progresses, he believes the current crop can continue to carry the torch.
"[They were] great characters over the period of time at our club.
"But that's our job to keep moving forward. It keeps evolving the B team, it will be relentless all the time and the movement in the transfer market.
"We want to keep adding better players all the time and keep improving and improving and improving.
"The players that have been with us, the ones you've mentioned, have done a terrific job for us and they just keep getting us to this stage, and we want to keep getting better and better as a group.
"We've got a terrific bunch of boys in that dressing room who are doing really well at the moment."
In his spare time, B team assistant coach Sam Saunders also plies his trade in the midfield of the Geordies in the Isthmian South Central Division. MacFarlane admitted that his inside knowledge benefitted the team's preparations.
When asked about the possibility of facing his right-hand man if he was eligible, the 44-year-old jokingly responded: "I wouldn't have let him play".
Brentford B's win has set up a date with Hampton & Richmond Borough next month for a place in the Middlesex Senior Cup final.