Rovers have not won a match by six points or less since seeing off Widnes 32-26 last July. Since then they have endured their fair share of close defeats, but this time Sandercock's side came through a tough battle to boost confidence ahead of Friday's first derby of the season at Hull.
"It is a relief to win a close game," he said. "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."
Rovers outscored their opponents five tries to four, with Travis Burns, Kris Welham, David Hodgson, Josh Hodgson and Craig Hall all crossing for the hosts.
Kirk Dixon, Jake Webster, Richard Owen and Daryl Clark were the tryscorers for Castleford, who came up just short despite holding a 16-14 lead at the interval.
Sandercock was grateful to be able to call on both his first choice half-backs after Michael Dobson and Burns passed late fitness tests.
"They were very close not to play," Sandercock said. "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 our two key playmakers and I'd rather have them there than not.
"It wasn't a risk playing them as we gave them a thorough fitness test and they came through it. 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 blamed his side's kicking game for their defeat at MS3 Craven Park.
"I was extremely disappointed with our kicking game," he said "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. I thought we were the better team in the first half."