St Helens stretched their lead at the top of Super League to three points with victory over Wigan Warriors.
Joe Burgess went over for Wigan and Tommy Makinson for St Helens as the two rivals were level at 4-4 at half-time.
Paul Wellens' score put St Helens ahead for the first time, before Josh Charnley's try levelled the match.
Mark Percival's goal edged the visitors ahead and he added the extras after Makinson's crucial try, as Charnley's late score proved in vain.
It was sweet revenge for St Helens, who were beaten 33-14 at home by Wigan back in April.
Sam Powell's grubber kick was collected by Burgess to go over in the corner to put Wigan ahead, although Matty Smith put his kick wide.
Mark Flanagan dummied his way through the Warriors defence as St Helens moved the ball from left to right and Makinson picked the ball out of the air to level, although he was unable to convert his own try.
The visitors had a try disallowed by the video referee after Burgess was adjudged to have got to the ball before Makinson to deny the St Helens man a second try.
Jon Wilkin's deft kick sent Wellens over for his third try in two matches as St Helens edged in front and Percival became the third player to miss an attempt at goal.
Matty Bowen's neat wide pass out to the wing enabled Charnley to go over, but Smith failed to add the extras and the game remained level at 8-8.
Percival's kick edged the league leaders into a two-point lead and he magnificently converted from the touchline when Makinson beat two men to charge over for his second try.
Wigan had a Burgess try chalked off for double movement, before Charnley quickly raced in for his second touchdown of the night to set up a tense finish, but Smith failed to add the conversion for a third time.
The hosts had pressure in the final seconds but St Helens hung on for their 14th win of the season.
St Helens coach Nathan Brown:
"I thought the officiating of the game was horrible. I thought Phil Bentham had an absolutely shocking performance.
"Waney has been whinging for the last two months and then we cop it on the backside today.
"We never ring Jon Sharp, we don't complain after any game and then you get a performance like that because other coaches are putting the referees under pressure.
"He's a good referee, Phil, and I'm not saying the 14 or 15 penalties that we got against us didn't deserve to be penalties, but I can assure you I'll be able to find another thousand you could have penalised Wigan for.
"I find it sad. We never complain but, as is the case in the NRL, the more you whinge, the better you get the calls."
Wigan coach Shaun Wane in response:
"That's absolute garbage, that's all I want to say about that.
"Nathan Brown shouldn't be allowed to say stuff like that.
"He came out with a comment at the start of the year about head-hunters and he got away with that.
"It's just disgraceful that he comes out with stuff like that. I'm fuming about that to be honest."
Wigan Warriors: Bowen, Charnley, Sarginson, Gelling, Burgess, S. Powell, Smith, Flower, Williams, Dudson, Hughes, Bateman, O'Loughlin.
Replacements: Taylor, Crosby, James, Doran.
St Helens: Wellens, Makinson, Turner, Percival, Swift, Hohaia, Walsh, Richards, Roby, Walmsley, Flanagan, Wilkin, Soliola.
Replacements: Masoe, Manu, McCarthy-Scarsbrook, Thompson.
Referee: Phil Bentham (RFL).