I don't think moths eat fungus gnats. Many moths don't even have functional mouth parts. (I am not sure about this one but Geometrids don't tend to feed.) Various critters can get tangled up at lights with cobwebs etc. The fungus gnat may be eating something. I have photographed them eating the cases of Spotted Gum Lerp Psyllid https://inaturalist.ala.org.au/observations/349707715