Sluice is a direct cognate to Dutch sluis, with the same meaning. The sluit in Afsluitdijk comes from a verb meaning "to close", which is indeed also cognate, but much more distantly: sluiten is inherited from a Germanic root sleutaną, but sluice/sluis comes from Latin exclūdō; both originate from Proto-Indo-European (s)kleh₂w- "hook, peg, nail", which has many descendants, from the Latvian verb for "to become" (via a meaning "to bend") and the Russian for "walking stick" to English cloister or French clé "key".