Wigan's Dom Manfredi ran in four tries to help his side beat Castleford 47-12 at the DW Stadium
The Warriors needed to beat the Tigers at home and hope Huddersfield did them a favour by defeating Leeds, but the Rhinos dug deep to beat the Giants 20-16 in the dying seconds to push Wigan into second place.
Wigan dominated proceedings early on at the DW Stadium with Manfredi and Matty Bowen crossing for tries to give the hosts a 10-0 lead after seven minutes.
However, despite plenty of possession, they failed to build on those scores and the Tigers made them pay as Luke Dorn dragged his team back into the contest after a fine break from Oliver Holmes, before Junior Moors also went over as the Tigers hit back to lead 12-10 at the break.
It was all Wigan after the interval, though, with winger Manfredi scoring three more tries as the home side punished the visitors by scoring twice while Denny Solomona was in the sin-bin.
Further tries from Oliver Gildart, George Williams, Joe Burgess and Larne Patrick ensured an emphatic win for the Warriors, although they fell just short of pipping Leeds to first place.
Dom Manfredi goes over for one of his four tries
Wigan took the lead after just four minutes as back-to-back penalties handed them good field position. They then spread the ball the full width of the field, and Manfredi was hand to score on his return from injury.
From their next set, Gildart's kick-through bounced off a Tigers defender and back to the centre who in turn ran across the field before sending Bowen through a massive gap and the Australian stepped round Dorn to score. Bowen added the extras to put Wigan 10-0 up.
The Tigers refused to lie down and, despite not being able to make the semi-finals, they were not just at the DW Stadium to make up the numbers, with Luke Gale and Moors impressing early on.
Bowen, though, was causing Castleford a world of problems with two impressive breaks and Gildart was forced into touch by a great try-saving tackle from Mike McMeeken as the Warriors tried to extend their lead.
Wigan's inability to make their pressure count came back to haunt them in the 27th minute as Castleford and referee Phil Bentham ignored cries of forward from the crowd and Oliver Holmes broke through before sending Dorn over in the corner. Gale converted with the score now 10-6.
It was the Yorkshire side who ended the half the strongest and they were soon in front as the impressive Moors took advantage of some slack defending to go over moments after Liam Farrell was penalised for a high tackle on Dorn. Gale converted as the Tigers led 12-10 at half-time.
Wigan were let off the hook five minutes into the second half as Matt Cook produced an amazing ball steal as Manfredi tried to clear his lines, but the second rower was hauled down as he set off in pursuit of a try.
The Warriors then turned defence into attack as they received a relieving penalty to march deep into Castleford's half and they took full advantage as the ball was spread to the right and Burgess sent Manfredi over in the corner for his second try. Bowen converted to put Wigan 16-12 in front.
The Tigers were reduced to 12 men with 24 minutes remaining when Solomona was sin-binned for lying on.
Wigan had their tails up now and they forced a goal line drop-out as a massive three-man hit, led by Sean O'Loughlin, forced Gadwin Springer back behind his own line. They made that extra man count as Bowen and Burgess again combined down the right and Manfredi forced his way over for his hat-trick.
The game was over as a contest after 61 minutes when Manfredi collected his fourth try of the night following a neat run and kick from Williams.