The home side took the lead in the fifth minute when Theo Fages managed to gather a loose ball deep in the Tigers' half and dummied an offload before going over the tryline for the score.
The Red Devils extended their advantage when Castleford knocked on from a grubber kick and Kevin Locke pounced on the ball and crashed over the line for the try, while he managed to convert the kick to hand his team a 10-point lead.
Gibson notched his second try of the game to level the scores at the break as he broke through a tackle to touch down just over the line, but this time Gale failed to convert the kick.
In the second half, Castleford took the lead when Kevin Massey found space in the middle of the Salford line to speed through and race over just wide of the left post, which allowed Gale to add the conversion.
Ash Robson compounded Salford's woes as he chased down a kick and managed to collect the ball on the bounce to power over the tryline and hand his side a 12-point lead.
Oliver Gildart gave the Red Devils a chance to get back into the game when he broke away through the middle and offloaded to Locke to complete the score, but the full-back missed the resulting kick to leave his team eight points behind.
The Red Devils piled forward in the dying minutes and scored through Scott Taylor, but it wasn't enough for the home side as they fell to a narrow defeat.