Diatomaceous earth needs to be dry in order to work on bugs... so I would say this is not your solution! If you have fungus gnats (and who hasn't?!), get yourself some Mosquito Bits and use it... the package will tell you how to do that but I soak 4 tablespoons of the granules in a gallon of water that I'm going to use for 30 minutes (I put the granules in a strainer to soak as it's easier to remove them) and then, after adjusting the PH if necessary, use it to water your plants (or add nutes if you're going to feed). Takes care of the problem almost immediately.... if you have a really REALLY bad infestation, they recommend using it once a week for 3 weeks.
Fungus gnats live in damp soil so it says to me you're probably overwatering.... make sure the soil is super dry between waterings/feedings...
Good luck!