Jamie Ellis converted a dramatic last-minute drop-goal to give a makeshift Castleford a thrilling 19-18 victory over top-four rivals Wigan.
The Tigers have managed to keep pace with Wigan despite their injury crisis and they moved to within a point of the Warriors after edging a thrilling Super League clash at the Mend-A-Hose Jungle.
Wigan, who were also depleted by injuries as well as England call-ups, took a 12-4 lead into half-time thanks to tries from Sam Tomkins and Liam Marshall either side of a Quentin Laulu-Togaga'e effort.
But Castleford came storming back and were on course for a memorable win after Michael Shenton and Matt Cook went over.
Cook went from hero to villain when he was sin-binned and Tom Davies scored in the next set but Ellis made sure his yellow card was not too costly to send Castleford five points clear of fifth-placed Hull.
The original fixture in March was postponed due to heavy snow but the players were treated to perfect conditions on a glorious Friday evening in West Yorkshire.
Wigan suffered a blow when Dan Sarginson was helped from the field inside three minutes and Castleford quickly tested stand-in centre Willie Isa's positional sense.
The Tigers created space on their left edge thanks to quick hands from Jake Trueman and Shenton, only for Jy Hitchcox - scorer of four tries in last week's draw against Hull KR - to put a foot in touch.
Tomkins did not need a second invitation at the other end after spotting a gap out wide, the full-back dummying his way through before crawling over the line.
Tommy Leuluai was held up after Laulu-Togaga'e became the second Castleford player to lose a high kick looking into the sun as Wigan turned the screw.
But the Tigers have battled manfully throughout their injury crisis and they were level when Laulu-Togaga'e made up for his mistake as he strolled over after taking Trueman's short ball.
Castleford were unable to build on the try and were undone by a brilliant 60-metre solo effort from Marshall, who spotted a gap in the Tigers defensive line before motoring through it and backing himself to beat the full-back.
The Warriors looked set to extend their lead when Morgan Escare raced clear after James Green lost the ball close to the Wigan line, but Castleford scrambled well and were grateful for Tomkins taking the two after conceding two penalties in desperation.
Tomkins missed a drop goal in the final seconds of the half and it took an ankle tap from Grant Millington to prevent Escare from going 80 metres just after the restart.
Castleford's comeback hopes were hit when Hitchcox was injured catching a high ball but the Tigers marched upfield from the penalty and Paul McShane put Shenton through a big hole in the Wigan defence.
Backed by a raucous home crowd, the momentum was suddenly with Castleford and they got back to 12-12 through Ellis' penalty after a high shot by Wigan.
Green bombed a try when he fired a poor ball to Junior Moors with the tryline begging but the Tigers did not have to wait long for their next score, Cook going over after surging on to McShane's pass.
But Cook left his team down to 12 men for the final 10 minutes after a dangerous tackle on Romain Navarrete and Davies made him pay immediately by racing away down the right to score.
Tomkins levelled the scores and then had a try ruled out in a frenzied finish before Ellis held his nerve.