I would say that the letter Y is being used as a consonant in the name NYE.
The following web page explains why this is so.
Because the letter Y is being combined with the vowel E in the same syllable and the vowel E makes the Y sound more like the letter I (NI) , it is being used here as a consonant.
If it was instead used in the name NY, it would be treated as a vowel.
Because there are no other vowels in that syllable, it is treated as one.