Kallum Watkins marked his 200th appearance for Leeds Rhinos with a try to help them overcome Wigan Warriors.
Ryan Hall and Joel Moon put Leeds 14-12 up at the break, while George Williams twice went over for Wigan in a ferocious opening 40 minutes.
The half ended with heated exchanges and Leeds' Brett Ferres was sin-binned for a tackle on Oliver Gildart.
Watkins added to Rhinos' lead and Carl Ablett sealed victory late on after Liam Marshall's try gave Wigan hope.
Leeds' fourth successive win since a 66-10 annihilation at Castleford meant they kept pace with the Super League-leading Tigers, with Rhinos second in the table and equal on points with their Yorkshire rivals after Daryl Powell's men thumped Huddersfield 52-16.
For Wigan, their second straight defeat - after their unbeaten start was ended by Hull FC seven days earlier - left them fifth.
Williams sidestepped his way around Leeds' defence for the game's first try after Ashton Golding kicked an early penalty for the hosts.
England half-back Williams was again at his elusive best to help edge Wigan back into the contest after Hall and Moon both crossed for Leeds.
While Golding again registered the first points of the second half with the boot, Watkins added to the lead in dramatic circumstances as Wigan's Nick Gregson had a try disallowed because of a double movement moments earlier.
Marshall's score ensured a tense finish before Ablett charged over three minutes from the end.
Leeds Rhinos coach Brian McDermott: "It was a real tiresome game. Wigan never went away, every time we threatened to put more points on them, they came back and made it a real contest.
"I still don't think I can tell you it's a blip what happened four weeks ago (against Castleford). Add another four weeks of improved performances and wins and we can look back on it as a blip.
"But I knew it was a blip at the time, we just faced a really hot team on the night. It wasn't the case that we had four weeks to save jobs."
Wigan Warriors coach Shaun Wane: "I'm depressed. I thought we could have won it, we were just dumb - we were not smart enough.
"We had a load of young kids who gave everything but at this level effort is not enough.
"I 100% expected to win, we put 17 players out there who could have won and they're devastated that they haven't and I'm devastated.
"But I don't want to take anything away from Leeds, who were the best team on the day.