Castleford maintained their winning start to the season defeating Wigan courtesy of Luke Dorn's late try.
Wigan led 24-22 at the break with Matty Bowen, Blake Green, Matty Smith, Tony Clubb and Joe Burgess all crossing.
Castleford's scores came through Kirk Dixon, Dorn, Adam Milner, Daryl Clark and three Marc Sneyd conversions.
And the Warriors looked to have won it through Smith's late drop goal but Dorn crossed and Sneyd converted the last minute to win the game.
Second rower Weller Hauraki combined with full-back Dorn to create a clear run to the line for winger Dixon to score the first try of the game.
Justin Carney was then sin-binned for swinging a punch at Wigan second rower John Bateman but the Tigers increased their lead with two more tries while down to 12 men.
Dorn caught the Warriors defence napping with a close-range effort and Bowen gifted a try to hooker Milner by fumbling Sneyd's kick.
Two goals from Sneyd put the home side into a 16-0 lead but Wigan stormed back to within two points with three tries in a seven-minute spell.
Bowen pounced on Smith's kick to score his first try in Super League, Green dummied his way over for his first of the season and Smith touched down after the ball had bounced into his arms off Carney.
Smith was able to land only one conversion, however, and the Warriors found themselves further in arrears when replacement hooker Clark burrowed his way over from dummy half on 27 minutes.
Sneyd's third goal made it 22-14 but the Warriors ended the first half with a flourish, with Clubb taking Logan Tomkins' short pass to crash over for his first try for the club and Burgess producing a devastating finish to a 60-metre move.
The Warriors were punished on 58 minutes when centre Michael Channing took Weller Hauraki's cut-out pass to score Castleford's fifth try which restored their lead.
Sneyd kicked his fourth conversion and added a penalty on the hour to make it 30-24 after Wigan prop Ben Flower had been sin-binned for a "cannonball" tackle.
The Tigers made good use of the extra man but captain Michael Shenton was denied what looked to be a certain try by Smith's last-ditch tackle and Channing took Dorn's pass to cross again at the corner only for referee Robert Hicks to blow up for an obstruction.
It looked to be a costly miss when Charnley collected Smith's kick to touch down at the corner before Smith landed a drop goal to put Shaun Wane's side in front but Dorn came to the Tigers' rescue with his second try of the match.
Defeat for the Warriors means they have lost three of their four matches this season and have just two points from their three Super League games.
Castleford coach Daryl Powell:
"It was some finish, unbelievable. I thought we had won it, drawn it and lost it and then we won it again. It was a crazy finish.
"It was incredible to come back from that drop goal and I'm delighted we were able to do that. We keep answering the questions that are being thrown at us.
"I thought we were outstanding with the ball, we caused Wigan all sort of troubles.
"Both teams had purple patches but we couldn't finish them off. I looked at at our boys (at) half-time and they were under the pump.
"We've got to expect to be in those battles. In previous years we haven't been.
Wigan coach Shaun Wane:
"It was very frustrating. We were a bit dumb.
"We came here ready to play but you can't give that many penalties away and make that many errors in the second half against a good side.
"Those five penalties in the first 20 minutes of the second half put us under too much pressure.
"If we had won, I would have been a bit embarrassed but I would have taken it.
"I think Cas were the best team overall. We weren't there today. We made a rod for our own back."
Castleford: Dorn, Dixon, Channing, Shenton, Carney, Sneyd, Finn, Lynch, Milner, Huby, Holmes, Hauraki, Millington.
Replacements: Mariano for Dixon (12), Wheeldon for Lynch (24), Clark for Milner (24), Massey for Huby (32).
Sin Bin: Carney (7).
Wigan: Bowen, Charnley, Sarginson, Thornley, Burgess, Green, Smith, Crosby, McIlorum, Taylor, L. Farrell, Flower, Bateman.
Replacements: Clubb for Crosby (21), Tomkins for McIlorum (31), Pettybourne for Taylor (20), James for Flower (30).
Sin Bin: Flower (61).
Ref: Robert Hicks (RFL).