A root Tolkien used to explain S. gûl “black arts, sorcery” (PE17/31), in one place describing it as a “darker” variant of √ÑGOL “dark-hued, dark-brown” in notes where Tolkien declared the name of the Noldor was not connected to wisdom (PE17/125). In the sense “dark with sinister connotations” the root √ÑGUL was also the basis for a couple Quenya words: Q. ñúla “dark, occult, mysterious” and Q. ñúlë “black arts, sorcery”. Elsewhere, though, S. gûl was derived from √ÑGOL “knowledge, wisdom” (Ety/ÑGOL; PE17/79; WJ/383), originally with the same neutral meaning as its Quenya equivalents, but:
> In S[indarin] the word gûl (equivalent of Q ñóle) had less laudatory associations, being used mostly of secret knowledge, especially such as possessed by artificers who made wonderful things; and the word became further darkened by its frequent use in the compound morgul “black arts”, applied to the delusory or perilous arts and knowledge derived from Morgoth (WJ/383).
Neo-Eldarin: I personally find this derivation of S. gûl from √ÑGOL “wisdom” to be more interesting etymologically, and prefer it over the root √ÑGUL. However, I think the Quenya words ñúla and ñúlë might be retained as loan words from Sindarin after the Noldor directly encountered the dark magic of Morgoth in Beleriand.