First attested 1564, borrowed from Middle French compartiment, from Italian compartimento, from Late Latin compartiri (“to divide with, to share with”), from com- + partiri (“to apportion, to divide, to share”).
Practice speaking and memorizing "compartiment" and many other words and sentences in Dutch.