I had a severe fungus gnat infestation my last grow, I tried sticky traps and mosquito dunks, but they didn't really help. I was well into flowering, so I bought some neem oil. I used 2 tablespoons of neem oil with a gallon of water and watered 3 plants that were in 3 gallon pots. I also put a tablespoon in a spray bottle with water. The spray bottle probably was 1 liter full. I used this to spray the top of the soil on all 3 plants as well as the pots themselves and all around the pots. I didn't spray that shit on my buds cause they were already 4 weeks into flowering. I quit using it after about 14 days because I didn't want my weed to taste like neem oil, and it didn't either. I also got rid of the fungus gnats. It just didn't happen over night. Fungus gnats lay their larvea in your soil after you water, and that is why drenching your soil with neem oil for example. I also put a layer of fish aquarium rocks over the soil of my 3 pots. I would've preferred sand, but Walmart didn't have any so I improvised. In the end it worked and that is all that matters to me. Plus, now I know how to deal with those pesky little gnats. I did spray the rocks that was on top of the soil during those 2 weeks as well as the whole pot of each of the 3 plants.
As far as your question goes I know that neem oil will work on powdery mildew. If I am correct about powdery mildew it gets on your leaves and basically looks like a powder on your leaves. I am looking at my bottle of neem oil right now and it says to mix a solution of 2 tablespoons to 1 gallon of water and spray the whole plant which includes both sides of the leaves. If your plants are budding then you will not want to spray your buds with this mixture. The instructions say nothing about getting rid of powdery mildew by drenching the soil with a neem oil mixture. It does say that it will kill powdery mildew in 24 hours. I was just reading the instructions and it doesn't say anywhere in there to drench your soil with neem oil to get rid of fungus gnats or anything else for that matter. So it might work but if you are flowering just spray the shit out of your plants and you will be good,