Hull ran in six tries to go into next weekend's home Super League play-off against Huddersfield in confident mood.
Willie Manu and Tom Briscoe crossed before the interval, supplemented by three goals from Jamie Foster, as Hull turned round with a 15-6 advantage.
Richard Horne and Danny Houghton then added tries, while Mark O'Meley and Chris Green both came off the bench to score, Foster adding three more goals.
Jordan Thompson and Oliver Holmes ran in the two tries for struggling Cas.
Rangi Chase, being openly courted by Hull for next season, gave the Cas fans a brief reminder of what they may be losing out on next season.
But the 2011 Man of Steel's performance was not enough to stop Hull winning at a canter at the KC Stadium.
Instead, it was a Hull player set for pastures new who turned the game, St Helens-bound Manu lighting up the KC one more time with his destructive running in a victory that owed everything to a dramatically improved second-half display.
After Thompson's try, improved by the departing Danny Orr, had cancelled out Manu's opening score for Hull, the hosts pulled clear with 24 unanswered points, including tries for Horne, Houghton and O'Meley in a dominant 10-minute spell.
Chase then set up Holmes up for a second Cas score. But Hull had the final word, scoring through young prop Green.
And coach Peter Gentle was pleased with a comfortable victory to head into next week's elimination play-off against Huddersfield in good form, having run up 106 points in their last two games.
Castleford, who have now lost their last seven matches, are joint-bottom, battling with Widnes to avoid the wooden spoon.
If Widnes beat neighbours Warrington on Sunday, then Cas would finish bottom for the first time since 2008.
VIEW FROM THE DRESSING ROOM
Hull FC coach Peter Gentle:
"I think there will be one or two dark horses in the play-offs and I don't see any reason why we can't be one of those sides.
"A whole new competition starts now. It is anybody's. There are four games left and I can't see any reasons why we can't play in all four of them to the Grand Final. I've seen enough from our blokes to suggest we can be one of those dark horses.
"It was hard in this game to find some rhythm with all the penalties and stoppages and I was frustrated watching the game. There was enough there from us for me though. To only concede two tries was pleasing and I was happy with the defensive hit-out that we had. We were after a team performance and we got one."
Castleford coach Ian Millward:
"We have a lot of work to do in all aspects of the club. Myself and my staff are up for that and as a club we need to learn why we've got in this situation. In all aspects of the club we need improvement.
"I thought our first half was really good and the scoreline at half-time flattered Hull. We were inches at times off getting more points.
"But it was disruptive to us when Danny Orr got injured with bad ribs so early and then we lost Daryl Clark, two of our best attacking players and I'm sure if they'd lost two of their best it would have had consequences.
"I put Danny back on with four minutes to go because I didn't want him to finish his career on the bench."
Hull: Horne; Foster, Crooks, Yeaman, T Briscoe; Seymour, Heremaia; Watts, Houghton, Lynch, Manu, Westerman, Pitts.
Replacements: O'Meley, Aspinwall, Tickle, Green.
Castleford: Owen; Youngquest, Snitch, Thompson, Blackmore; Chase, Orr; Huby, Clark, Massey, Millington, Holmes, Hudson.
Replacements: Emmitt, Walker, Mitchell, Milner.
Referee: Rob Hicks (Oldham).