Yes, that is cognate with ancient Greek μελαγχολία, and with the same root: μέλας
https://en.wiktionary.org/wiki/melancholy