The Warriors raced ahead with a brace of tries from Sean O'Loughlin before Waine Pryce hit back to make it 12-6.
Quick tries from Michael Platt, Paul Handforth and Richard Fa'aoso gave Tigers a commanding lead.
Andy Kain kicked well and added a try, while Pryce also went over, to ensure late Wigan scores would not be enough.
Castleford coach Terry Matterson: "We should have been 12 points up at half-time - but that's probably just us being greedy," he said.
"It's been a massive turn-around here, and it's all down to the personnel. We had a good hard look at ourselves.
On the improvement in form he added: "We've been losing to teams by scores we shouldn't have been losing by."
Castleford: Platt, Pryce, Shenton, Bird, Viane, McGoldrick, Kain, Sculthorpe, Henderson, Nutley, Fa'aoso, Whitaker, Fletcher. Replacements: Handforth, Dyer, Manu, Ward.
Wigan: Ashton, Calderwood, Richards, Brown, Dallas, Orr, Moran, Logan, Higham, Hargreaves, Hansen, Prescott, O'Loughlin. Replacements: Fletcher, Vaealiki, Godwin, Seu Seu.
Referee: P Bentham (Warrington).