The sound /ɲ/ does not occur in English; /nj/ is an English speaker's approximation to it. That is how we pronounce some French words (cognac, vignette) or Spanish words (cañon --> canyon) that have been borrowed into English.
it’s interesting to note that there’s one nasal that is pretty common in the world’s languages in general, but which we don’t have in English: the palatal nasal, ɲ.
When we borrow words containing a palatal nasal from languages that do have one, we have two possible strategies: map it onto nj, or map it onto simple n.
The English sequence /nj/ is one sound followed by another, whereas [ɲ] is palatal all the way through. But sounds don't get made in separate pieces, one after another. When we say /nj/ we probably start moving from the [n] position to the [j] position while we're still making the [n]. So there might be a sequence [nɲj], where it's hard to say where one ends and the next begins.
There are languages, such as Italian, that have both /ɲ/ and /nj/. It is possible to distinguish them.