Despite scoring five tries to four - and playing against 12 men for three-quarters of the game - Tigers could never quite get back on terms after trailing 18-0 inside the opening 14 minutes.
The loss of England half-back Luke Gale proved disastrous for Tigers, who could have gone two points clear at the top of the table.
Gale was hurt in a high tackle by Hull prop Liam Watts on 22 minutes and did not return.
Watts was sent-off, but Hull - who had conceded more than 50 points in each of their previous two home games - responded with a sensational defensive performance.
Cas didn’t help themselves, Hull’s first three tries all coming in penalty sets.
Scott Taylor forced his way past Zak Hardaker for the opener after just five minutes and two later Mahe Fonua squeezed in at the corner from an outstanding offload by Jake Connor.
When Castleford finally got a sight of Hull’s line Ben Roberts was penalised for complaining about a forward pass decision and in the resulting set Marc Sneyd’s kick was knocked back by Connor and Fonua touched down.
Sneyd converted all three - the second via a post - but Castleford’s fightback began within seconds of the sending-off when Greg Minikin shrugged off Sneyd to get over from Jake Webster’s pass.
Then a Sneyd kick to the corner was well claimed by Greg Eden, who raced into Hull’s half. He was hauled down by Albert Kelly, but Roberts dummied over from acting-half after Mike McMeeken had gone close.
Sneyd landed a long-range penalty - after a high tackle by Oliver Holmes on Connor - five minutes before the interval, but Castleford responded with a glorious score on the final play of the period.
Roberts began the move by breaking from his own half and Webster was in support to provide the final pass for Michael Shenton. After Roberts had failed to convert the opening two tries, Paul McShane - who switched from hooker to half-back in place of Gale - took over kicking duties and added the extras to cut Hull’s half-time lead to six points.
In the second half Tigers made the mistake of trying to score on every play, when more composure was needed.
Hull survived some heavy pressure before Sneyd landed a penalty goal following a high tackle by Jesse Sene-Lefao, seconds after missing with a similar effort when the ball was stolen from Fonua by McShane.
Roberts went over from Grant Millington’s pass, but the conversion was missed and Hull went two scores clear with 17 minutes left, Carlos Tuimavave crossing from Steve Michaels’ offload after he had gathered Kelly’s kick.
McMeeken scored Tigers’ fifth try on the final play of the game, but the hooter went before McShane - ironically - landed a towering touchline conversion.
Hull FC: Shaul, Fonua, Tuimavave, Connor, Michaels, Kelly, Sneyd, Taylor, Washbrook, Watts, Manu, Minichiello, Ellis. Subs: Green, Thompson, Turgut, Fash.
Castleford Tigers: Hardaker, Minikin, Webster, Shenton, Eden, Roberts, Gale, Lynch, McShane, Springer, O Holmes, McMeeken, Milner. Subs: Millington, Sene-Lefao, Moors, Monaghan.
Referee: Robert Hicks (Oldham). Attendance: 12,801.