Paul Hart's men were 3-0 up after 47 minutes but then saw County stage an amazing comeback to snatch a 3-3 draw.
Barnsley had started brightly and had taken the lead in the 14th minute when Stephen McPhail's well-flighted corner was met by skipper Tony Vaughan who netted with a bullet header.
Seven minutes later a terrific Barnsley move down the right touchline ended with Michael Chopra's driven cross being met by strike partner Michael Boulding but his glancing head was brilliantly saved by County keeper Neil Cutler.
Stockport did look dangerous themselves going forward and lively striker Warren Feeney hit the base of the post in the 27th minute.
But Barnsley looked well on their way in the 43rd minute when a mistake by County centre-back Ashley Williams led to Chris Shuker lashing home in glorious style from 22 yards.
And Barnsley looked home and dry two minutes after the re-start when skipper Vaughan popped up again inside the County box to meet a corner from Jacob Burns and send his looping header soaring past the stranded Cutler.
But then the home side took their foot off the gas and Stockport struck back in stunning fashion.
Feeney punished a Barnsley defensive error to score on the hour and then, following a positive double substitution, Stuart Barlow capitalised on a mistake by keeper Ross Turnbull to make it 3-2 on 72 minutes.
And the fightback was complete nine minutes from time when a low right-wing cross was tapped home at the far post by Rickie Lambert.