I wouldn't spray anything on the plant, this is really an issue of moist top layer in your soil. This is where they and the eggs will be dwelling. CKbrew has a good suggestion with the diatomaceous earth, which is water soluble, so don't apply it before or right after you water. Another way to try and manage fungus gnats is by letting the top layer of the soil get a little dry in between waterings. The wet top layer is their preferred environment.
I'm not sure what sort of pot you are using, but some people have even cone a few bottom feedings instead of watering in the top. This will still get water to the root zone, but it also keeps the top layer dry. It's not something I recommend for the whole life of the plant, the would be an ebb & flow table, but doing it a few times to manage the gnats shouldn't hurt you any.