Giants had taken a 40-6 lead, but the home side amassed 18 points in the final three minutes of the game.
The Huddersfield coach told Sky Sports News: "The closing stages definitely took off some of the gloss although I thought we were the better team throughout.
"Castleford asked us questions and for 10 to 15 minute spell at the end we basically put the cue on the rack and gave in and just doing enough was sufficient.
"We could have been better but we got two points and I'm happy because it keeps us where we want to be. We lost the energy battle towards the end but we racked up some points and we should probably have scored more."
The result moved Huddersfield to the top of the Super League table.