While the neural crest is not considered a true germ layer (like ectoderm, mesoderm, and endoderm), it is derived from the ectoderm.
Therefore, you could say that melanocytes are indirectly derived from the ectoderm through the neural crest.