Sam Tomkins was the hero as Wigan snatched their first win at Headingley for six years.
A drab Betfred Super League contest burst into life in the last 10 minutes as the Warriors came from 8-0 down to claim a 9-8 victory over a Leeds side which led for most of the match.
Tomkins converted Oliver Gildart's 72nd-minute try from the touchline to bring his side to within two points and then kicked a penalty and a drop goal to secure a precious victory.
The Rhinos, who had a chance to leapfrog their opponents into second spot, went close to claiming a share of the spoils in a gripping finish, with half-backs Joel Moon and Richie Myler both failing with drop-goal attempts, and in the end were left to rue a series of missed chances.
Leeds were bolstered by the return of Moon, Adam Cuthbertson, Brett Delaney and Anthony Mullally and were clearly the better side in the first half without making it tell on the scoreboard.
Perhaps it was a hangover from the hectic Easter programme but the major talking point from a first half littered with handling errors and penalties was provided by the intervention of a streaker who appeared to be given free reign on the pitch just before the half-time whistle.
The only try of the half came midway through it when Leeds ran a penalty in front of the Wigan posts and their enterprise paid off with winger Tom Briscoe taking Myler's cut-out pass to cross unopposed at the corner.
Skipper Kallum Watkins added a touchline conversion to give the home side a 6-0 lead which they deserved on the balance of play.
Watkins twice went close to increasing the lead while Wigan were indebted to the defensive efforts of full-back Tomkins, who marred an otherwise impressive display with a couple of handling errors on attack.
The Warriors withdrew skipper Sean O'Loughlin midway through the first half and had scrum-half Sam Powell sin-binned two minutes into the second half for a "crusher" tackle on full-back Ashton Golding but Leeds failed to take advantage.
They would have doubled their lead had Myler been able to take Watkins' pass with the line at his mercy but his handling let him down.
The visitors looked more purposeful when O'Loughlin, fresh from orchestrating their comeback win over Catalans Dragons, returned to the action after 50 minutes.
They forced three goal-line drop-outs but were unable to turn the pressure into points and, when Leeds received a penalty within kicking range, Watkins took the opportunity to put his side two scores in front.
Wigan finally cracked the Rhinos defence nine minutes from the end, centre Gildart taking Liam Farrell's pass to finish off one of the best moves of the match.
Tomkins' touchline goal cut the gap to two points and Wigan almost scored again when substitute prop Ryan Sutton broke clear and found Gildart but Joe Burgess could not take the final pass.
The game looked set to end in a draw when Tomkins kicked a penalty four minutes from the end after Powell was tackled high by Delaney but the Wigan full-back had the final say when he landed a one-pointer from 35 metres out.