Tom Bradshaw's sixth and seventh goals of the season helped Barnsley on their way to a first away Championship win of the season at Millwall's expense.
The Reds grabbed the three points they deserved when wrapping up victory late on thanks to sub Mamadou Thiam's well-converted spot-kick.
In the first game between the two sides since the Reds' epic League One play-off final win at Wembley in May, 2016, the visitors saw full debutant Cameron McGeehan go close with a strike from distance early on.
Brad Potts fired narrowly wide, before the Reds did eventually strike the opener in the 40th minute.
Following a neat move down the flank, Bradshaw converted a Harvey Barnes cross from close range.
As the game headed towards first-half stoppage-time, the Reds conceded a penalty when Matty Pearson felled Lee Gregory.
It was a hotly-contested decision, one which ultimately cost Reds boss Paul Heckingbottom his place on the touchline as he was sent to the stands at half-time following protestations to referee Mr Langford.
Gregory dusted himself down before sending Adam Davies the wrong way from the spot.
The Reds restored their lead on the hour mark.
And it was the same pair who combined, with Bradshaw converting another Barnes cross to make it 2-1.
Millwall pressed hard for an equaliser, and Davies was superb in somehow beating away Steve Morison's goal-bound header.
At the other end, Potts' thumping header was superbly saved by Jordan Archer.
It was 3-1 in the 83rd minute when Thiam stroked home from the spot after fellow sub Jared Bird had been tripped in the box.
Millwall (4-4-2): Archer; McLaughlin, Webster, Hutchinson, Meredith (Onyedinma, 81); Wallace, Tunnicliffe, Saville, O'Brien (Ferguson, 63); Morison, Gregory.
Subs not used: Martin, Craig, Thompson, Romeo, Cooper.
Barnsley (4-1-4-1): Davies; McCarthy, Jackson, Lindsay, Pearson; Williams; Hammill, McGeehan (Bird, 80), Potts, Barnes (Thiam, 71); Bradshaw (Hedges, 71).
Subs not used: Townsend, Fryers, Ugbo, MacDonald.
Referee: Oliver Langford (West Midlands).