Goals either side of half-time from Barnsley's Tom Bradshaw sealed a 3-1 victory at Millwall to move the Tykes three points clear of the Championship relegation zone.
Lee Gregory's penalty in first-half stoppage time levelled things up at 1-1, cancelling out Bradshaw's 40th-minute opener.
But the 25-year-old striker found the net again on the hour mark, before Mamadou Thiam wrapped up Barnsley's first away win of the season with a late penalty - despite manager Paul Heckingbottom getting his marching orders for remonstrating with the referee just after half-time.
Millwall probably shaded the first half, enjoying the lion's share of possession, but were ultimately lucky to go in level after Bradshaw netted five minutes before the break.
The striker slotted the ball home from close range past goalkeeper Jordan Archer, after a cross came from Harvey Barnes on the left side.
Gregory had squandered a golden opportunity in just the third minute, seeing his right-footed shot saved superbly by goalkeeper Adam Davies.
Cameron McGeehan and Adam Hammill - trying to recreate his 2016 play-off final stunner - were both unsuccessful with long-range efforts for the Tykes, while their hosts continued to be wasteful.
Barnsley stopper Davies again saved well as Steve Morison came close with a header, assisted by centre-back Byron Webster - who fell awkwardly on his ankle midway through the half but was able to continue after treatment.
But while the visitors thought they had done enough to go in ahead, Millwall were awarded a penalty just before half-time when Matty Pearson brought down Gregory inside the box.
And up stepped the Lions' striker to confidently send a superb penalty into the top-left corner.
Barnsley manager Heckingbottom was sent to the stands by referee Oliver Langford right at the start of the second half, after the Tykes boss attempted to dispute the earlier penalty decision.
However Bradshaw's second goal of the afternoon gave Barnsley the lead after 60 minutes - the Welshman sliding the ball into the back of the net on the edge of the six-yard box, assisted by Barnes.
Millwall's best effort to equalise came when Conor McLaughlin found substitute Shane Ferguson unmarked inside the box but his attempt went over the crossbar.
The Tykes chose to sit back after regaining the lead, hitting their hosts on the break and earning a counter-attacking penalty when Jared Bird was fouled.
And replacement Thiam sent Archer the wrong way and cleverly put the ball into the bottom-right corner to extend Barnsley's lead.