Paul Mullin and Aaron Hayden both scored twice as Wrexham ran out winners after a topsy-turvy 12-goal classic at the Racecourse Ground.
Hayden fired Wrexham in front early on before Nicke Kabamba and Harry Pritchard put the visitors 2-1 ahead before the half-hour mark.
Tom O’Connor’s deflected strike and Mullin’s first of the game turned the match around again, putting them 3-2 up, but Idris Kanu levelled shortly after the break.
Wrexham turned on the style to surge clear, however, as Mullin, Luke Young, Hayden and Ollie Palmer scored in an 11-minute period to make it 7-3.
But Barnet pushed to the wire, with Kabamba and Kanu both doubling their tallies to wrap up the scoring in a memorable match.
Phil Parkinson named two changes to the side that fell to a narrow defeat at Meadow Lane on Tuesday, with O’Connor and Elliot Lee replacing James Jones and Jordan Davies.
Hayden broke the deadlock inside the opening ten minutes after a strong header back into the penalty area by Max Cleworth landed at Hayden’s feet, and he stroked it home.
Lee nearly made it two, two minutes later as he worked the ball inside the box, and unleashed a well-timed strike, forcing Laurie Walker into a smart save.
The Red Dragons continued to pile on the pressure and Ollie Palmer came close to doubling the advantage, as he headed just over Walker’s bar.
Kabama levelled just before the half-hour mark, however, after Hayden's tame header landed at the striker's feet, and his shot trickled past Mark Howard.
The Bees found themselves ahead minutes later, as Pritchard’s near post header beat Howard and found the far post.
However, Wrexham broke back almost from kick-off, as O’Connor’s free kick from 30 yards was deflected and went into the top corner.
Mullin completed the five-minute comeback to go ahead at the break as Elliot Lee slotted him in on goal, and the striker pounced, converting his tenth goal of the season.
Five minutes into the second half and Barnet got back on levels terms, as Danny Collinge split the defence, and Kanu slotted past Howard.
Just like the first half, it only took Wrexham a matter of minutes to re-capture the lead, however, and it came from the penalty spot, as Mullin both won and converted the penalty.
Wrexham made it five in style, as Young fired home from outside the area, scoring his first goal for the club since May 2021.
Before the hour mark, Hayden got his second, with his towering header flying into the top corner, leaving Walker rooted to the spot.
The Red Dragons' pressure continued to mount, and Lee came close to making it seven, as his dipping volley from outside the area made Walker produce an unbelievable save, tipping it over the bar.
Lee’s creative intuition continued as he played an excellent through ball into the path of Palmer, who finished coolly past Walker to get that seventh goal.
Despite the relentless nature of Wrexham in front of goal, Barnet weren’t phased by that and got themselves a fourth, as Kabama got ahead of his man, and finished well past Howard.
Kanu then got the goal of the day and Barnet’s fifth, after his 30-yard strike rocketed into the top corner, leaving Howard unmoved.
Kabamba had an opportunity to make it six and secure his hat-trick as he pounced on Hayden and Tozer’s mix-up, but his shot was well saved by Howard.
Despite seven minutes’ stoppage time, there were no further goals, as Wrexham ensured they returned to winning ways – albeit in slightly bizarre fashion.
The Red Dragons will now return to action next weekend in the FA Cup away to Blyth Spartans, with broadcast details to be confirmed.
Match highlights from today’s enthralling encounter will be live on WrexhamPlayer this evening.
Wrexham: Howard (GK), Forde (Hosannah 74’), Hayden, Tozer, Cleworth, McFadzean, Young ©, O’Connor, Lee (Jones 77’), Palmer, Mullin (Dalby 88’)
Subs not used: Watson and McAlinden
Bookings: Luke Young (38’), Elliot Lee (44’), Paul Mullin (86’), Ollie Palmer (96)
Barnet: Walker (GK), Wynter, Collinge, Phillips, Okimo, Kanu, Gorman © (Shields 67), Pritchard, Flanagan (Hall 56’), De Havilland, Kabama,
Subs not used: Azaze, Diarra, Woods
Bookings: Michael Phillips (53’) and Dale Gorman (55’)