You don't get fungus gnats from watering too much, this is classic correlation verus causation. Yes, fungus gnats tend to prefer moist environments, but will lay eggs whereever there is the slightest chance they could survive. They will lay eggs in soil that is more or less bone dry.
They tend to occur when an adult female fungus gnat (or more) comes by to lay a hundred or so eggs, at a time. They survive because there are limited to no predators in the indoor potting mix.
Underwatering is not beneficial and can/will hinder growth. I would recommend a biological control, like the Gnatrol or Mosquito Dunks or Bits. Both contain the Bacillus thuringiensis isreali bacterium endospores, and an associated larvacidal toxin it produces which kills fungus gnats, mosquito and blackfly larva. Mosquito Dunks are available at virtually every garden center and some carry the Mosquito Bits, which are somewhat more convenient to use. Dunks you can just soak in water, or break up and soak and water, for about 24 hours and then apply. Do it every two weeks.
Also, use sticky stakes or fly strips to catch the adults and keep an eye on the population. If it is really bad, use a vacuum cleaner to go after adults. There is also pyrethrin spray, an insectide derived from Chrysanthemums which breaks down rapidly (usually with piperonyl butoxide as a synergist). There is usually really no need to use anything more toxic for fungus gnats in soil. I keep living predators (Hypoaspis) in my soil that eat fungus gnats. Some people use beneficial nematodes, but those need to be applied periodically.