They were trailing 2-0 at half time to Josh Windass' double after an opening 45 minutes in which the hosts were second best by a long distance.
But they were level after just 15 minutes of the second period with Kal Naismith and Ryan Tunnicliffe scoring, before Elijah Adebayo then headed home a dramatic late winner.
The visitors had led on six minutes as a short goal kick was given away by Luton inside their own half and Callum Paterson got clear on the right before cutting the ball back for Windass to score.
Windass looked for a second moments later, making his way in from the left, but dragged wide of the target from outside the box.
It was all Wednesday in the opening stages, Julian Borner unable to divert his header on target while Kadeem Harris saw two shots deflected behind as the visitors continued to have the better of proceedings.
They should have led 2-0 on 21 minutes, when Windass was clean through the middle and faced with just Simon Sluga to beat, the attacker shooting wastefully off target.
Sluga did well to prevent Matt Penney's long range attempt from flying in, with an offside Paterson sending the rebound well over.
However, as Luton tried to get through to the break just 1-0 behind, a second arrived as a completely unmarked Windass lashed a cross into the top corner.
Luton boss Nathan Jones made three changes at the break and Town gave themselves a lifeline inside three minutes of the second half, Naismith meeting a corner on his left foot to divert a first goal for the club into the corner.
It was 2-2 on 58 minutes as Adebayo did well on the left, sending a low cross into the box where Tunnicliffe advanced to beat Joe Wildsmith and notch his first goal of the season.
Adebayo then wriggled clear in the area and could only shoot into the side-netting, while Pelly-Ruddock Mpanzu failed to reach Kiernan Dewsbury-Hall's searching cross at the far post.
Paterson went close for the Owls midway through the half, his volley not missing by much, while Luton tried to get a third, Tunnicliffe slamming over.
There was to be a winner though and it came for the Hatters with just four minutes left.
Harry Cornick did superbly on the right to stand up a cross for Adebayo to power home a downward header and complete a stunning turnaround which not many would have predicted.
Support The Yorkshire Post and become a subscriber today. Your subscription will help us to continue to bring quality news to the people of Yorkshire. In return, you'll see fewer ads on site, get free access to our app and receive exclusive members-only offers. Click HERE to subscribe.