Hull KR recorded their fourth win of the Super League season as Castleford's struggles continued.
The Robins looked comfortable early on with tries from Travis Burns, Kris Welham and David Hodgson, while Kirk Dixon touched down for Cas in reply.
Jake Webster and Richard Owen then went over to put the Tigers in front before Josh Hodgson restored Hull's advantage.
Craig Hall's finish increased the lead and although Daryl Clark pulled one back, the hosts held on.
The victory did not move Rovers out of eighth position, but it did create a two-point gap over local rivals Hull FC.
Castleford were left still searching for their second win of the campaign, but could take encouragement from their refusal to be overwhelmed by their hosts.
They were two tries behind early on, with Burns, who picked up 10 of his side's points, just about touching down and Welham latching on to Michael Dobson's delicate kick.
The Robins were pegged back when Dixon capitalised on Dave Hodgson's fumble to score before kicking the extras himself.
Hodgson made amends when he finished a slick move in the corner, but the visitors rallied once more when Webster crossed, perhaps fortunately, as the pass from Rangi Chase looked to have been played forwards.
The Tigers were in front at the break when a series of quick passes put Owen in to touch down.
The lead was short-lived though, with Josh Hodgson going over and then Hall scoring, even though Burns's kick was knocked on by Josh Hodgson.
Cas set up a nervy finish as Greg Eden hesitated under a high ball to allow Clark in for a try, but Ian Millward's side remain next to bottom.
VIEWS FROM THE DRESSING ROOM
Hull KR coach Craig Sandercock said:
"It is a relief to win a close game.
"I don't think we have won a close game for a while. We seem to win really easily or let games slip away like we did against Bradford, but I'm very pleased.
"Travis Burns and Michael Dobson were very close not to play.
"They had their fitness tests this afternoon because the pitch was covered in snow on Saturday, which prevented the fitness tests taking place then.
"They are important parts of our plans and if there was any doubt they couldn't have got through the game, we wouldn't have played them."
Castleford coach Ian Millward said:
"I was extremely disappointed with our kicking game. It was one of the worst kicking games I've seen in a long while.
"We put ourselves under a lot of pressure with the way we kicked today and I was surprised with how close the game was.
"We are not coming to places to play close games, we're coming to places to win and we're extremely disappointed to lose."
Hull KR: Eden; Brown, Welham, Hall, D Hodgson; Burns, Dobson; Paea, J Hodgson, Tuimavave, Cox, Paterson, Griffin.
Replacements: Carlile, Horne, Mika, Beaumont,
Castleford: Owen; Thompson, Shenton, Webster, Dixon; Chase, Tansey; Mason, Milner, Huby, Gilmour, Hauraki, Holmes.
Replacements: Ellis, Clark, Millington, Massey.
Referee: J Child