Match ends, Wigan Athletic 3, Barnsley 2.
Substitute Nick Powell scored an 11-minute hat-trick as Wigan boosted their Championship survival hopes by coming from 2-0 down to beat Barnsley.
The former Manchester United forward came on in the 66th minute and scored with a free-kick five minutes later before tucking in to level.
He won the game with a penalty after being pushed by Angus MacDonald to leave Wigan four points from safety.
Adam Armstrong had fired the Tykes in front before Ryan Kent's stunning shot.
Matty James thought he had earned Barnsley a point when he lashed a shot into the net late on, but it was ruled out for a push on Wigan keeper Jakob Haugaard.
Wigan's victory lifts them above Blackburn to 22nd in the Championship table, four points behind Bristol City, who play their game in hand against QPR on Good Friday.
There was little evidence of the drama to come during a drab first half of limited openings. Armstrong put the visitors ahead with their only shot on target by slotting the ball home on the rebound after Kent's shot came back off the post.
When Kent cut in from the wing to fire in the second with his left foot there seemed no way back for the Latics, only for Powell to turn the game on its head.
The 23-year-old had also come off the bench to score a 90th-minute winner against Rotherham on Saturday but his impact was even more telling as Wigan collected back-to-back home league wins for the first time this season.
He pulled one back when his 71st-minute free-kick was parried into the net by Davies and levelled two minutes later when the Barnsley keeper could not hold Ryan Colclough's shot.
And the comeback was complete when he drilled his penalty straight down the middle to give the Latics an unlikely victory.
Wigan interim manager Graham Barrow: "On talent alone Nick Powell deserves to be in the Premier League and that's why you put him in that bracket.
"I am just glad for the supporters that we have given them something back for sticking with us all season; we have just got to carry on now. It would be fantastic to take it to the final day of the season, if we can't do it before."
"I'd be lying if I said I thought he could go on and get a hat-trick but then you know he's always going to make an impact.
"At 2-0 down with so long left in the game it was by no means over, but Nick got the goals so early and made the win a possibility."
Barnsley boss Paul Heckingbottom: "At 2-0, we were defending well and they had lots of shots from distance and we weren't really troubled. We were a constant threat on the counter.
"After the second goal, we started to control the ball a lot better and it was a crazy five minutes.
"We focus on us and our players and mistakes are mistakes. You have to limit them if you want to play as high as you can and we know that.
"It's cost us the game, and the players concerned know about it. They know exactly what they've done wrong and if that happens they don't play."
- 12ConnollySubstituted forByrneat 54'minutes
- 33BurnBooked at 78mins
- 16MacDonaldBooked at 45mins
- 26HansonBooked at 90mins
- 8MorsySubstituted forColcloughat 45'minutes
- 11ObertanSubstituted forPowellat 66'minutes
- 21JankoBooked at 53mins
- 5MacDonaldBooked at 78mins
- 29JonesBooked at 76mins
- 15WatkinsBooked at 49mins
- 32A ArmstrongSubstituted forScowenat 80'minutes
- Simon Hooper
- Shots on Target
Second Half ends, Wigan Athletic 3, Barnsley 2.
Attempt saved. Ryan Kent (Barnsley) right footed shot from outside the box is saved in the top right corner. Assisted by Gethin Jones.
Ryan Colclough (Wigan Athletic) wins a free kick in the defensive half.
Foul by Saidy Janko (Barnsley).
Nick Powell (Wigan Athletic) wins a free kick on the left wing.
Foul by Josh Scowen (Barnsley).
Jamie Hanson (Wigan Athletic) is shown the yellow card for a bad foul.
Foul by Jamie Hanson (Wigan Athletic).
Ryan Kent (Barnsley) wins a free kick in the defensive half.
Jakob Haugaard (Wigan Athletic) wins a free kick in the defensive half.
Foul by Tom Bradshaw (Barnsley).
Nick Powell (Wigan Athletic) wins a free kick in the defensive half.
Foul by Gethin Jones (Barnsley).
Attempt missed. Max Power (Wigan Athletic) right footed shot from outside the box misses to the left. Assisted by Jack Byrne.
Delay over. They are ready to continue.
Delay in match Jamie Hanson (Wigan Athletic) because of an injury.
Stephen Warnock (Wigan Athletic) wins a free kick in the defensive half.
Foul by Josh Scowen (Barnsley).
Goal! Wigan Athletic 3, Barnsley 2. Nick Powell (Wigan Athletic) converts the penalty with a right footed shot to the high centre of the goal.