Dan Sparkes came in for Charlee Adams in the Bees’ only change from last weekend’s defeat against Gateshead and made an immediate impact, opening the scoring inside seven minutes.
That goal proved to be the winner as John Still’s men progress to the Third Round for the first time in a decade.
The first chance of the game fell to the Bees when Byron Harrison won a free-kick from outside the area. Sparkes stepped up to take before looping the ball over the wall, narrowly falling wide of the post.
It didn’t matter though as the Barnet number 11 found himself on the score-sheet three minutes later. A cross was whipped in by Cheye Alexander and he was on hand to head the ball home to give the hosts an early lead.
Alexander could have grabbed one himself soon after. The full-back did well to cut inside before letting fly on the edge of the box but it could only found the arms of Ben Hinchliffe.
Adam Thomas had an equaliser in his sights on 23 minutes, curling the ball on target but it was comfortable enough for Mark Cousins.
The Bees nearly doubled their lead soon after when a Sparkes corner found the head of Dan Sweeney but his attempt was blocked on the line.
Another chance fell the hosts’ way four minutes before the break when Sparkes whipped a low ball into Harrison but his effort from close range flew over.
Despite Darren Stephenson’s dangerous low cross in stoppage time that forced Cousins into a save, Barnet went into the break a goal up.
Wes Fonguck produced the first chance of the second half, curling the ball from the edge of the box but it deflected out for a corner.
Elliott Johnson then whipped in a delightful ball from the left before Harrison’s header was flagged for offside but Hinchliffe made an extraordinary save to deny him nonetheless.
Soon after, a misplaced back-pass found its way to Josh Walker who let rip from distance but it was tipped over by the Stockport ‘keeper.
Frank Mulhern then had a glorious chance to equalise just past the hour mark after Cousins lost grip of the ball, falling to the County man who poked it wide from close range.
Craig Robson, who scored in both games against Bristol Rovers in the previous round, tried his luck from range with 15 minutes remaining but Hinchliffe got down low to save.
With three minutes remaining, substitute Manny Duku saw his strike from outside the area fly over the bar moments before receiving a yellow for a foul.
Despite late pressure from the visitors, the Bees held on to clinch the win.
The draw takes place on Monday night where Barnet will find out who they will play in the next round.
Barnet Starting Line-up: Cousins, Alexander, Johnson, Reynolds ©, Robson, Harrison (Duku), Sparkes, J.Taylor, Fonguck (Adams), Walker (Elito), Sweeney.
Unused Subs: Matrevics, Coulthirst, Mason-Clark, Bettamer
Goal: Sparkes 7’
Stockport Starting Line-up: Hinchliffe, Cowan, Minihan (Bell), Keane (Dimaio), Palmer ©, Scott, Thomas, Walker, Mulhern, Osborne (Warburton), Stephenson.
Unused Subs: Ormson, Turnbull, Downing, Robinson.
Attendance: 2826 (1542 visitors)