On-loan Marcus Tudgay's injury-time goal secured lowly Barnsley a victory at in-form Millwall.
Darius Henderson missed an early penalty for the Lions before Stephen Dawson put the visitors ahead with a close-range finish.
Millwall defender Adam Smith was sent off but the hosts equalised when Chris Wood produced a neat finish with 10 minutes left.
However, Tudgay's 93rd-minute strike ended Barnsley's 11-match winless run.
The home side had the chance to move ahead midway through the first-half when Scott Wiseman was penalised for a challenge on Henderson.
But Henderson failed to capitalise, thumping the spot-kick over the crossbar.
Dawson tapped in his third of the season for Keith Hill's team after Millwall goalkeeper David Forde saved Jim O'Brien's shot.
Millwall faced an even tougher task when referee Trevor Kettle showed Smith a straight red for a lunge at David Perkins.
Wood pulled Kenny Jackett's side level when he collected Dany N'Guessan's ball over the top and guided a shot past Luke Steele.
But Tudgay thumped in the third goal of his loan spell from Nottingham Forest to inflict a second defeat in 17 games on Millwall.
Millwall manager Kenny Jackett: "Looking at the key points in the game we've missed a penalty, the sending off was a harsh one which we will be appealing, and the winning goal looked close to being offside.
"Going down to 10 galvanised us and we played better so it's hugely disappointing to lose.
"We were going all out for the win and it showed at the end. The penalty miss wasn't the only turning point in the game but it did have an effect on its outcome."
Barnsley manager Keith Hill: "I'm delighted with the performance and delighted with the effort but let's not get carried away.
"We must take it into the next game. We've been working hard all week on what we wanted to do. We had to give Millwall respect as they've been in excellent form and it worked for us."
Hill felt Smith's red card was harsh on the hosts, adding: "I don't think it was a sending-off, and at best it was a yellow.