Saints celebrate their play-off semi-final win in front of the dejected Wigan fans
St Helens twice came from behind to book their place in the Super League Grand Final for a sixth straight year.
Wigan led 12-8 at the break with tries from Josh Charnley and recalled Eamon O'Carroll, either side of Lee Gaskell's stunner on the burst for Saints.
But Saints turned it with second-half tries from Paul Wellens, Jamie Foster, who kicked five goals, and James Roby before Sam Tomkins' late consolation.
And that booked Saints' date with Leeds at Old Trafford next Saturday night.
Victory over the reigning champions now means Saints have the chance to end their run of four straight Grand Final defeats, especially to avenge their three successive losses to Leeds, in 2007, 2008 and 2009, as they bid for a first Super League triumph since their double-winning year of 2006.
While it means a Grand Final for Saints coach Royce Simmons to end his first season in charge, it was a disappointing finale for his fellow Aussie, South Sydney-bound Michael Maguire, in what proved his final game in charge.
SAINTS' GRAND FINAL RECORD
1999 Bradford 6-8 St Helens
2000 St Helens 29-16 Wigan
2002 Bradford 18-19 St Helens
2006 St Helens 26-4 Hull
2007 Leeds 33-6 St Helens
2008 Leeds 24-16 St Helens
2009 Leeds 18-10 St Helens
2010 Wigan 22-10 St Helens
And, although Saints enjoyed the breaks on the night as they ended Wigan's dream of the double, the home side defended superbly to ultimately deserve a second play-off derby victory by the same scoreline inside a fortnight - and payback in particular for their 22-10 Grand Final defeat by Maguire's men at Old Trafford a year ago.
It is also the first time since the Grand Final began in 1998 that it will not be contested by either of the teams finishing the regular season in the top two.
After dominating the early exchanges, Wigan drew first blood through Pat Richards' early penalty before the visitors went one better when Foster's error triggered the game's first try.
Thomas Leuluai stabbed a neat enough kick to the corner, Foster's attempt to kick clear ended with an air shot and he then missed his tackle as Charnley galloped in for his 23rd try of the season.
Richards pulled the conversion and worse was to come for Wigan when they passed up a great chance of a second try, Joel Tomkins failing to hold onto a scoring pass from brother Sam with the Saints line gaping.
It always looked likely to be a crucial moment, especially when Saints then took a real foothold in the contest.
Wellens was held up over the line by Sam Tomkins and Leuluai before Gaskell wasted a great opportunity following a clean break down the middle. But Gaskell then made no mistake two minutes later when he burst through to register his fourth try in five games.
Foster added the extras before slotting a penalty to make it 8-6 but back came Wigan when O'Carroll, who has had such an unhappy time with injuries, came off the bench to score his first try for more than three years.
Saints' James Graham delayed his end of season departure for Australia
Fed by Leuluai, the Hull-bound prop rolled in next to the upright, Richards slotting the conversion for a 12-8 half-time lead.
Wellens then tied it up at 12-12 when Wigan allowed him in wide out on the left for the 200th try of his career, Foster adding the extras and then slotting a penalty for a four-point cushion.
Four crucially became eight when Foster himself went in at the left corner, his first missed kick of the night leaving Saints 20-12 up going into the final quarter.
Wigan battered away in search of an opening but Sia Soliola snaked out an arm to stop a charging Harrison Hansen before Michael Shenton did the same to deny Sam Tomkins. And, having withstood everything Wigan could throw at them, it was all over bar the shouting when Roby nipped in for his side's fourth try.
Sam Tomkins made the scoreline a bit fairer with the final score of the night, converted by Richards, who landed three of his four kicks at goal.
But, in their final game at the temporary Stobart Stadium home, after another classic derby which saw veteran prop Andy Coley into retirement and also brought to an end to the Wigan careers of fellow forwards O'Carroll and Aussie Ryan Hoffman, it was Saints' night.
St Helens coach Royce Simmons:
Saints boss delighted to beat 'champion' Wigan
"They got a couple of early penalties and were on a roll for the first 18 minutes. They didn't let us into an attacking position. A lot of sides wouldn't have hung in. It was a draining period for us. But we scrambled really well and made some last-ditch tackles.
"I was confident at half-time. I thought we were playing as individuals a bit in the first half and we said that, when we played as a team, we looked dangerous.
"Leon Pryce trained with us yesterday but rang the doctor at nine this morning. He was vomiting and had diarrhoea. We said we'd judge it again at two o'clock but he wasn't even in a position to drive here."
Wigan coach Michael Maguire:
"These are always tough games and you don't always get what you want. But I'm very proud of this group of players and what we've achieved in my time here.
"We've had the win at Old Trafford, we had the minor premiership last year and we've had the Wembley experience on the way. It's been a big achievement and we've added to the great history of Wigan.
"Tonight we had chances throughout the game where we could have been a bit more effective. We needed to make sure we capitalised on them. But, full credit to Saints, every time we play them, it's always an intense game and nothing changed tonight. It's just unfortunate that it fell the wrong way."
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.