More on KentOnline
Jack Parkinson scored an injury-time winner to send Maidstone through to the FA Cup third qualifying round on Saturday.
The hosts looked set to be held to a draw by their Ryman League Division 1 North opponents until Parkinson met Alex Flisher's corner in the fourth minute of added time.
Brentwood took a shock lead when Robbie Rees found the top corner with a cracking strike from 20 yards.
The visitors were given no time to settle on their lead with Frannie Collin setting up Ben Greenhalgh whose shot was blocked on the line.
An equaliser looked a matter of time and it arrived on 12 minutes from a smart move involving Flisher, Alex Brown, Collin and Parkinson before Aaron Simpson's cross was headed home by Greenhalgh.
Brentwood started to put themselves about more as the half wore on, looking to put favourites United out of their stride.
It worked to a point but there were still good chances for Maidstone to go in front before half-time with Flisher heading inches wide from Greenhalgh's cross and Collin denied by a smart save after turning on Tom Mills' ball into the box.
Brentwood threatened early in the second half with Rees and Alex Akrofi working Lee Worgan as United started slowly.
And as the visitors continued to enjoy their best spell of the match, Worgan was forced into a decent full-stretch save after Shad Ngandu dispossessed Parkinson.
Maidstone responded by introducing rested pair James Rogers and Matt Bodkin.
They pushed hard in the last 10 minutes with Bodkin's near-post strike saved and Ashley Miller's fierce volley blocked.
Miller saw another strike go agonisingly wide in injury time before Parkinson's late heroics.
Maidstone: Worgan, Simpson, Mills, Coyle, Miles, Brown (Rogers 67mins), Greenhalgh (Miller 79mins), Parkinson, May (Bodkin 67mins), Collin, Flisher. Subs not used: Iandolo, Watt, Jordan, Godmon.
Attendance: 1,464.