Hull KR were 19-12 behind but Matt Parcell and Kane Linnett crossed at Hull College Craven Park to ensure their team remains in the hunt for the play-offs in the final round next weekend, along with the Tigers and Leeds.
It was a nervy, slow start for both sides, perhaps because of the importance of the result to both.
But in the fifth minute, the hosts took the lead through Lewis.
Linnett busted through a handful of tackles on the left edge and drew Niall Evalds to put the half-back over easily, before Abdull added the extras.
However, the lead lasted just seven minutes thanks to a blockbuster run by Oliver Holmes. The forward broke through some weak defence and he offloaded to put Evalds over to score, and Danny Richardson nailed the conversion to tie it up at 6-6.
In the 20th minute, Castleford took the lead for the first time through Derrell Olpherts.
After a break in the middle of the field, the Tigers spread the ball quickly and found space on the wing for Olpherts to touch down and Richardson’s kick from the sideline was perfect to make it 12-6.
Finally in the 27th minute, Hull KR’s constant pressure paid off when Lewis ran at the line, stepping past some defenders to barge over before Abdull’s conversion levelled matters.
With two minutes left in the half, Richardson kicked a drop-goal to edge Castleford ahead at the break.
In the second half, it was the Tigers who started brighter and they increased their lead just two minutes in due to a smart offload from Michael Shenton.
With the Robins’ defence stretched, the veteran centre cut back inside and popped a pass to Evalds for the full-back to grab his second of the night.
Richardson’s third-successful conversion extended the lead to seven points.
The home side scored after a bomb from Abdull caused havoc in the Castleford in-goal after 55 minutes. The ball was knocked on and Parcell scooped up the leftovers to touch down, before Abdull added the extras and suddenly the Tigers’ lead was cut to a single point.
There was more drama to come as Linnett powered over from short range to snatch the lead back for his team. Abdull made no mistake and suddenly Hull KR were 24-19 ahead.
The Robins were riding a wave of momentum and Castleford appeared all at sea.
The Tigers rallied in the final stages, building set after set and Adam Milner was held up over the try-line.
But Hull KR held on grimly and Abdull added a final penalty goal to grind out the result.