MATTY Smith booted a dramatic penalty with second remaining to give Wigan a stunning victory.
The Warriors had been clinging onto a six-point lead when, in a frantic finish, Rob Burrow’s footwork opened up a tired defence, to lock the scores.
But in the final minute, Carl Ablett’s break was halted by referee Richard Silverwood - who spotted an obstruction - and Smith stepped up to strike the resulting penalty.
It proved a grandstand finish to a thrilling, high-quality game which will please Wigan’s loyal faithful.
The win cut Leeds’ lead at the top to just two points but, with two matches to go before the Super 8s, it looks unlikely the Warriors will climb to the summit before the season splits.
Even so, this victory puts them in a good position to strike should the Rhinos slip up, and it raises the prospects of Shaun Wane’s outfit finishing the 23 rounds above St Helens in second - securing a home ‘derby’ in the Super 8s.
After two defeats from their last three matches, against Saints and Warrington, this was the perfect tonic.
It wasn’t perfect, not every attack came off, and their defence napped for one of their opponents’ tries. But overall they were spirited, energetic and bold.
Ben Flower, John Bateman, Tony Clubb and Sean O’Loughlin led a strong forwards effort and, on the back of that, Matty Smith was assured and Matty Bowen exciting.
Not for the first time this summer, Wigan went into a match against Leeds on the back of a weak performance. Sure, their 17-6 defeat at Warrington a week earlier may not have been as embarrassing as the 58-16 mauling in Catalans, but the pressure felt similar - particular with the table so congested.
But the Warriors rose to the occasion at the Magic Weekend, triumphing 27-12 with a spirited, magnificent performance. Their imperious home record - they had not lost a Super League home match in a year - and the return of some frontline stars prompted bookmakers to install the Warriors as pre-game favourites.
O’Loughlin (thigh) and Clubb (knee) returned from injury, England winger Josh Charnley replaced Dom Manfredi (ankle) on the wing and George Williams (neck) was passed fit to play.
Leeds were forced to move England centre Kallum Watkins moved to fullback to replace suspended Zak Hardaker, while their recent recruit from the NRL, Mitch Garbutt, missed the game with a back injury.
Footballer Joey Barton - a Warriors fan - was among the fans watching the match, their second of three Thursday night games within a four week block. Barton even made an appearance at half-time to conduct the club’s lottery draw.
By that point, Wigan had built up an 18-12 lead which they probably deserved, following a free-flowing, entertaining half.
Bowen scored two tries in his last appearance against Leeds, and he enjoyed another lively performance. He broke early to send Liam Farrell close, yet after such a bright start, they went behind to a soft try.
Paul Aiton darted from dummy-half, between McIlorum and George Williams, to break the deadlock. Kevin Sinfield’s first conversion made it 6-0 to the visitors.
Wigan drew level in breathtaking fashion. Joe Burgess raced clear down the left flank and, aware the covering defence would have blocked a try, had the poise and presence of mind to chip the ball midfield, into the path of the supporting Farrell.
Moments later, captain O’Loughlin bulldozed beyond Watkins and - with Smith adding both goals - Warriors led 12-6.
They gained confidence from their improved display, showing flashes of adventure down the right where Charnley was twitching for involvement.
But Leeds locked the scores when Adam Cuthbertson’s neat pass sent Brad Singeton through a gaping hole for a converted try.
Aussie Cuthbertson wants to play for England later this year, and on this evidence, many fans may be happy to have him. He drove the ball strong and frequently managed to promote the ball with offloads, and on one occasion it needed the video referee to harshly rule out a sweeping Danny McGuire ‘try’ for obstruction.
The seesawing exchanges continued apace, and Wigan marched down the field where Bowen anticipated, chased and collected Smith’s angled kick, and beat McGuire to the ball to score.
The opening of the second half was a more nervous affair. But by the 50th minute, it was the Warriors who found a way through when Bowen jetted through from the scrum-base, providing the position for Smith to float a measured kick over for Charnley to touch down. Smith nailed the conversion to make it 24-12.
After McIlorum squandered a half-chance to extend their lead, the Rhinos cut the marin to six points with a carbon-copy try - Ash Handley collecting a bobbling kick by Sinfield, in probably his last game at the DW.
The quality of Wigan’s kicking game dropped, but they remained in the arm-wrestle as the match entered the final quarter and kept backline stars Watkins and Ryan Hall on a tight leash.
Dan Sarginson had to leave the action with a leg injury, while Wigan were indebted to Charnley for a double-tackle to prevent a Leeds try in a frantic final five minutes.
But after forcing a drop-out, Leeds’ persistence eventually paid off when Burrow’s footwork opened up a tiring defence, and he crossed for a try which Sinfield converted to lock the scores.
Wigan: Bowen; Charnley, Bateman, Sarginson, Burgess; Williams, Smith; Crosby, McIlorum, Flower, Tomkins, Farrell, O’Loughlin. Subs: Clubb, Mossop, Tautai, Patrick.
Leeds: Watkins; Handley, Keinhorst, Moon, Hall; Sinfield, McGuire; Leuluai, Aiton, Peacock, Delaney, Ablett, Cuthbertson. Subs: Burrow, Singleton, Walters, Yates.
Referee: Richard Silverwood.
Starman: John Bateman