The Tigers have yet to win this season in Super League, but showed some bright glimpses of promise in an end-to-end contest, not least a hat-trick for centre Paul Mellor.
However, the Warriors - led excellently by fit-again Adrian Lam - had too much in the final outcome to continue their run of form ahead of the Powergen Challenge Cup Final in a fortnight.
The Tigers had an early let-off when Brett Dallas was pulled back for a forward pass, but there was no stopping the winger on four minutes after he intercepted Ryan Hudson's pass to race 70 metres.
Mellor grabbed his first try on nine minutes following Francis Maloney's kick, and two Wayne Godwin goals put the hosts, who had winger Michael Shenton and scrum half Dominic Brambani on their full debut, 8-6 up.
Kris Radlinski denied Mellor a second before Lam put young centre Kevin Brown over before the half hour, and Terry Newton's try gave the Warriors a 14-8 interval lead.
Andy Farrell's two missed conversion attempts looked costly when Tom Saxton touched down a minute after the restart following rookie Desi Williams' error, Godwin levelling matters.
Dallas then touched down again on 46 minutes to edge Wigan six points ahead, but two quick tries, to Mellor and Jamie Thackray, and a Francis Maloney penalty put Castleford into the ascendancy.
Wigan, though, moved 32-24 up with two converted tries inside as many minutes after the hour mark, Lam grabbing his first of the year before Gareth Hock put Newton in for his second.
Mellor's third try pulled Castleford to within four points, and although Newton was denied his own hat-trick, prop Craig Smith and Radlinski touched down in the final three minutes to seal the victory.