Justin Carney scored a hat-trick as Castleford beat Salford City Reds.
The visitors, second bottom of Super League, were 20-6 down after tries from Michael Channing, Michael Shenton, Carney and Dan Fleming.
But the Reds took the lead through Danny Williams crossed and a Jodie Broughton hat-trick.
However, Rangi Chase, Channing and Carney added four quick tries and Jordan Thompson finished the game after Williams had grabbed his second.
It was a third consecutive victory for the Tigers, who finish the season at Wakefield next Sunday.
Salford, meanwhile, sit only a point above bottom club London Broncos and face Widnes at home on Friday.
Castleford coach Daryl Powell:
"It looked during the first half and parts of the second that it was an end of season game that didn't mean a lot but we found enough to score some quality tries.
"From an attacking point of view we did some smart things but we just lost our way for a period which is pretty typical of us.
"The positive thing at the moment is that we are able to grab it back and we are finding enough character to win games from tough positions. I am really pleased that we got the two points but we lack consistency and that's why we are where we are in the table.
"But there's loads of positive like there is every week."
Salford coach Brian Noble:
"We just couldn't go on with the game after we took the lead.
"Castleford had a couple of players that know how to change a game and Rangi did that for them and that's why he is the player he is.
"From our point of view I was again disappointed because we are clearly competing.
"I thought we gave Castleford too much of a leg up in the first-half and it was like a game of touch and pass at times in the second half.
"We have a good group and it is disappointing because in the last couple weeks we have been in a position to win games. We just fell off with 10 to 15 minutes to go here whereas if we'd been a bit smarter with some of our own plays it would have helped us."
Castleford: Tansey, Dixon, Channing, Shenton, Carney, Chase, Ellis, Boyle, Milner, Huby, Millington, Hauraki, Massey.
Replacements: Clark, Thompson, Fleming, Reynolds.
Salford: Gaskell, D. Williams, Gibson, McGoldrick, Brotherton, Sneyd, Fages, Griffin, Owen, Emmitt, Ashurst, Dixon, Wild.
Replacements: James, Davies, J. Walne, A. Walne.
Referee: Chris Leatherbarrow (RFL)