Wigan held off a tremendous onslaught in a JJB Stadium thriller to condemn engage Super League champions Leeds to a third defeat in four matches.
The Rhinos, who trailed 23-6 after an hour, looked set to pull off a sensational victory after scoring three tries in a frantic and dramatic 10-minute spell that cut the gap to a single point but Rob Burrow missed a last-minute 40-metre penalty.
Leeds could now lose top spot if St Helens beat Harlequins by 32 points at the Twickenham Stoop on Saturday.
Wigan had earlier turned on the style to stun the visitors with three first half tries without reply.
Winger Cameron Phelps, the Warriors recent signing from Canterbury Bulldogs, grabbed two tries in the first nine minutes as the home side made a dream start.
Leeds, whose lead over Saints had been cut to just two points after back-to-back defeats by their nearest rivals and Harlequins, were boosted by the return of their six England internationals.
Wigan, on the other hand, lost front row forwards Iafeta Paleaaesina and Paul Prescott from the side that beat Harlequins a week ago and gave a debut to 19-year-old back-row forward Chris Tuson.
But the Warriors front-line forwards set a tremendous lead, with Stuart Fielden and Andy Coley magnificent in defence and attack as the home side scored from the first set of six tackles.
A neat off-load by Gareth Hock freed full-back Pat Richards, and although the supporting Thomas Leuluai was eventually hauled down, the Rhinos were sufficiently stretched for Phelps to win the race to touch down Brent Barrett's perfectly-judged kick.
Richards added a conversion, the first of three goals, and Leuluai combined with centre George Carmont to get the Australian over for his second try.
When Leeds eventually got their hands on the ball they looked threatening, and Wigan were forced to scramble to keep their line intact.
Coley pulled off a superb last-ditch tackle to deny the dangerous Brent Webb and Fielden demonstrated Wigan's spirit by tracking back to punch the ball ahead of the chasing Danny McGuire.
When the champions eventually crossed the winning line they were denied by video referee Steve Ganson, who spotted winger Ryan Hall's foot brush the touch-line.
The Warriors were able to demonstrate superior clinical finishing and stretched their lead after 29 minutes when substitute Liam Colbon re-gathered Leuluai's lofted kick to claim his side's third try.
It was an almost perfect 40 minutes for Brian Noble's men and Richards put the seal on it with a drop goal seconds before the break, which was to prove ultimately decisive.
It was a similar story in the second half with Burrow looking dangerous only to lose the ball over the try line, but it was the diminutive half-back who sparked the fightback with 51 minutes gone.
His trademark dash through the heart of the Wigan defence took him clear and, when his former Rhinos team-mate Mark Calderwood got back to haul him down, McGuire was in support to finish off the move.
Kevin Sinfield, whose 63-match scoring sequence came to an end when he sat out last week's win over Castleford, started a new run with the conversion to make it 17-6.
Richards calmed Wigan's nerves with a second penalty and centre Darrell Goulding looked to have sealed the win when he fought his way out of tackles to score a fourth try on the hour.
There seemed no way back from 23-6 but the Rhinos launched all out attack and, aided by a string of penalties, put the home defence under almost constant pressure in the final quarter, which produced three quick-fire tries.
A long pass from McGuire enabled Hall to squeeze over at the corner and three minutes later winger Scott Donald palmed the ball back from Burrow's kick for Keith Senior to touch down.
Sinfield's second conversion cut the gap to seven points and it was down to one eight minutes from the end when another clever pass from McGuire found Gareth Ellis in space to score.
With Sinfield off the field, Burrow added the conversion and he was handed a glorious opportunity to win it at the death when Wigan were pulled up for offside 40 metres out but his kick fell short and wide of the target.