
A goal at the death by skipper Dale Gorman means that Barnet draw level on points with league leaders Chesterfield in the race for promotion.
Former Peterborough United winger Idris Kanu opened the scoring in under five minutes for the hosts, unleashing a stunning top-corner finish from distance.
Maidenhead pegged the Bees back only seven minutes later, with Reece Smith and Jayden Mitchell-Lawson combining for the equaliser with a well-worked cutback across goal.
Laurie Walker and Craig Ross pulled off important saves to deny their sides from falling behind, but it was Bradley Keetch who caught Walker out in the fourth minute of added time to give the visitors the lead.
Callum Stead brought the Bees back level after the interval with a perfectly placed header off Anthony Hartigan's free kick.
With the game drawing to a close tied at 2-2, some individual magic from Gorman found Barnet back on top in the 91st minute. The former Yeovil Town midfielder curled a shot past Ross from 20 yards for the eventual match-winner.
The game wasn't finished without some added drama. Maidenhead boss Alan Devonshire was shown red after the goal, with defender Sam Beckwith following suit minutes later alongside two of the Magpies' management staff.
The visitors are on the road again on Tuesday night, travelling to the EBB Stadium to face a high-flying Aldershot Town.
Meanwhile, Dean Brennan's Barnet have a huge fixture against 3rd-place Solihull Moors in less than 72 hours. The Moors were undefeated until the 7th October, but have been in a slump since, losing 5-0 to Southend United.
Story of the game:
The hosts made two switches to the side that beat National League South side Aveley comfortably in the 4th qualifying replay in the FA Cup.
Danny Collinge picked up an injury in the game, forcing Brennan to rotate with Ben Wynter. Callum Stead was preferred to Gorman, with the Bees opting for more attacking depth.
Meanwhile, Alan Devonshire's side made three changes to the side that won in the FA Cup last weekend. Chanka Zimba, James Golding and Charlee Adams took the places of Harry Parsons, Toby Sho-Silva and Casey Pettit.
It only took three and a half minutes for the deadlock to be broken. Idris Kanu picked up the ball from the left, driving into the centre, before unleashing a stunning curling effort from outside of the box, flying into the top right corner.
Kanu has four goals this season - already half of his goal tally last season, showing the improvement in his game already at the start of the season.
However, the lead was to be short lived. Walker was called into his first save of the match, parrying Mitchell-Lawson's cross out of danger. Yet after the good work from the Bees' number one, an individual error from Ben Wynter allowed Reece Smith to dance through into the box before cutting back across goal to Mitchell-Lawson for the equaliser.
The momentum suddenly switched to the visitors. Bradley Keetch tested Walker with an ambitious effort from 20 yards but it was denied comfortably with both hands.
Barnet's top-scorer Kabamba almost put Barnet back in the lead minutes later, forcing Craig Ross into an excellent fingertip save from a header off Hartigan's free-kick.
Chances were coming quickly for the Bees to jump ahead on home soil. Courtney Senior saw his low-drilled shot glare just wide of the bottom right corner.
A frantic start to the game was slowed down as both sides adapted to the damp and miserable conditions, in the wake of Storm Babet's arrival to the capital.
Senior came close again on the half-hour mark, drilling his shot just wide of the left on this instance after a great counter-attack from Hartigan and Pritchard.
It was the latter that forced Ross into another excellent save on the next attack, pulling out another routine fingertip save from a long, looping header by the Bees' number 14.
However, it was Barnet's keeper, Walker, who made an important save to keep the scores level as the game approached the interval. Mitchell-Lawson bursted through on the right and fired one at the former Stevenage goalkeeper, who remained composed and denied the 24-year-old from a second.
Chanka Zimba was rueing the chance missed to take the lead, taking the ball around Walker but denied off the line by an outstretched Jerome Okimo.
The Magpies did make it two deep into the five minutes of injury time, with Keetch firing from range to give the visitors the advantage going into the break.
It was Barnet who started again on the front foot in the second 45. A Hartigan free-kick was met in the air by Callum Stead, heading past Ross with ease to give the Bees a pathway back into the game.
The ex-Brackley Town forward now has three goals in nine appearances for Barnet since signing this summer.
Maidenhead started to become frustrated as the rain poured down at a dark, gloomy Hive Stadium. Referee James Durkin showed he wasn't afraid to pull out yellow cards, booking Goulding, Adams, Beckwith and Keetch in quick succession, adding to the three bookings he made already.
The visitors thought they had a third when Mitchell-Lawson bared down on goal again, but his effort heading for the bottom corner was deflected onto the crossbar, saving the Bees from a potential match-winner.
Substitute Dale Gorman came agonisingly close to scoring on the 80-minute mark, if not for another one-handed save from Ross to prevent the 27-year-old.
It was Gorman who sealed the game for the Bees in the first minute of injury time, curling an effort from the 20-yard range into the back of the net. The linesman initially flagged for offside to the dismay of the home support, but after a discussion with the referee, the goal was awarded.
Manager Alan Devonshire was clearly dissatisfied with the incident - seeing red from Durkin for his say on the sideline.
As Barnet steered towards taking all three points, the game started to flare up. A controversial decision from Durkin saw Sam Beckwith picking up a second yellow card offence for dissent, as well as two Maidenhead management staff sent off for their involvement.
A ten-men Maidenhead side couldn't create a threat in the final two minutes, with Barnet heading level on points with Chesterfield after gaining three more important points.
Player of the match:
Barnet - Anthony Hartigan
The Mansfield Town loanee was simply the best player on the pitch. Playing as the main sweeper in the midfield, all Barnet's motion was through the 23-year-old.
Having been left on the bench due to Mansfield's sheer talent in midfield, the Irishman has been an incredible coup for Dean Brennan's squad as they hunt for promotion.
Brennan was immensely proud of his midfielder in his post-match interview, mentioning that he loved that 'Hartigan always plays forward' and gloating that 'his pass completion is a joke'.

