Is there a way to chemically detect the presence of Fungus in a sample?
You could test for the presence of chitin, which is a fundamental component of fungal cell walls.  There is precedent for this: https://apps.dtic.mil/dtic/tr/fulltext/u2/a036986.pdf

Chitin is not only present in fungi though, it is also fundamental to insect and crustacean exoskeletons, and the occasional plant species (e.g. Aegagropila).