Depending on your exact situation starving your plants of water is probably not going to solve the problem. I don't care what people say, I have seen fungus gnats swarming and laying eggs happily in practically bone dry soil.
It is better to prevent them in the first place and if you don't have too many of them now take the following measures: have plenty of sticky traps of all kinds, the ones that hang and the ones that go on stakes directly in your container. Vacuum up as many adults as you can. DE will work in other areas where you see them flying, on the floor, in crevices, but it needs to be dry in order to work. Bacillus thuringiensis israelensis or Bti is a bacterium that produces a toxin that causes fungus gnat larvae to die once they ingest it. It is very narrow spectrum and is only toxic to a few types of pests including gnats, and mosquitoes. Bti is what is in Mosquito Dunks, but liquid formulations are more available these days. This should be applied once a week, or every other week to prevent them.
Beneficial nematodes are also effective, as are predator mites.