The Reds are through to the Second Round of the Carabao Cup after a late, late winner from substitute Ryan Hedges.
In atrocious conditions at Oakwell, the Reds and visitors Morecambe served up an entertaining encounter in this First Round clash.
An early pair of Reds goals from Tom Bradshaw and an own goal by Mitchell Lund looked to have set Barnsley up for a comfortable night's work. But Sam Lavelle's injury time strike before half time gave our visitors hope.
Barnsley restored the two goal advantage when Bradshaw nodded in his second, before The Shrimps hit back with a disputed penalty and then levelled with a Vadaine Oliver finish.
But Paul Heckingbottom's side came out winners when Hedges grabbed his second goal in as many games to send the Reds through to the next round.
The Reds Gaffer had made a handful of changes from the weekend defeat in Bristol, with most notably Matty Pearson making his first start since signing last Friday from Accrington Stanley.
It was the perfect start for Hecky's men when Bradshaw fired home impressively after latching onto George Moncur's through ball.
He could have had another when Adam Hammill swung in a trademark delivery, but Bradshaw's deft finish was superbly tipped around the post by Nizic in the visitors goal.
On 22 minutes the lead was doubled; Ike Ugbo raced down the right flank at pace before seeing his cut-back deflected into his own net by Lund for 2-0.
But in first half stoppage time the away side grabbed a lifeline, Lavelle finding the top corner with a clean hit from 12 yards out.
HALF TIME: Barnsley 2-1 Morecambe
Barnsley restored their two goal advantage when Bradshaw did grab his second. It was pretty much straight from the second half restart; his header from an Hammill cross beating Nizic who was caught in no-man's land.
However, just a few minutes later and Morecambe were awarded a hotly-disputed penalty. Joe Williams was adjudged to have fouled his man in the box and up stepped captain Michael Rose to slot home confidently beyond Adam Davies.
It was 3-3 and all to play for when on 81 minutes Oliver's effort from an acute angle somehow found its way into the far corner despite the best efforts of the Reds defence and Davies on the line.
But just before the final whistle blew, which would have signalled another 30 minutes of play, up stepped Hedges to make his mark once again.
Hammill and Moncur linked brilliantly again, they fashioned space and Hedges found a yard before curling home an unstoppable effort from 20 yards that beat Nizic all ends up.
And so into the hat for Round Two the Reds will go!
FULL TIME: Barnsley 4-3 Morecambe
Reds: Davies (GK); Pearson, MacDonald (c), Pinnock, Yiadom; Potts (Hedges '88), Moncur, J.Williams (Mowatt '88), Hammill; Ugbo (Payne '76), Bradshaw.
Unused: Townsend (GK), Mallan, Jackson, McCarthy.