A Michael Gash goal secured all three points for Barnet, in a dominant performance at The Hive.
Second half substitute John Akinde opened the scoring for the Bees, slotting home a Gash pass after 59 minutes.
Michael Coulson levelled things up in the 79th minute with a powerful effort, before Gash strike put Barnet back in front three minutes later.
Josh Clarke made sure of the points with a debut goal in injury time.
The Bees had the first chance of the match, when Andy Yiadom’s right-sided free kick was headed over the bar by Michael Nelson after 11 minutes.
Bondz N’Gala then missed a guilt-edge chance with 19 minutes on the clock – skewing a shot wide of the right post after a neat pass from Gash.
Elliott Johnson hit a free kick straight at Scott Flinders in the York goal from a central position, ten minutes before half time.
The Bees completely controlled the first half, but struggled to carve out many clear-cut opportunities.
The first chance of the second period fell to Yiadom; his free-kick flew high and wide of the goal on 57 minutes.
Barnet took the lead just two minutes later; Akinde finishing past Flinders after a through ball from Gash.
Jamie Stephens had to be alert on 69 minutes – tipping Coulson’s powerful drive over the bar.
Gash then headed wide of the right post from a 78th minute Sam Togwell corner.
Against the run of play York levelled in the 79th minute – A low Coulson drive beating Stephens in the Barnet goal.
Parity lasted just three minutes however, as the Bees soon regained the lead.
A left sided free-kick was laid off to Gash, who powered the ball home from 20 yards.
On 87 minutes Akinde found himself one-on-one with Flinders, but the forward’s shot was deflected over.
The Bees made sure of the points in injury time when Clarke picked up the ball on the right side and finished neatly to cap an impressive debut.
Barnet were deserved winners and will head to Hartlepool on Tuesday full of confidence.
BARNET: Stephens, Johnson, N’Gala, Nelson, Clarke, Yiadom ©, Weston (Togwell 76’), Gambin (Nwogu 52’), Champion, Gash, McLean (Akinde 52’).
Subs Not Used: Hoyte, Muggleton, Stevens, McKenzie-Lyle.