Overwatering often leads to a problem with fungus gnats. Constantly damp soils promote fungal growth, which serves as an excellent food source for the larvae. Simply cutting down on watering has solved many a fungus-gnat issue. Water infested houseplants deeply, but not frequently, and only when the soil is dry. Be sure the pot itself has good drainage and the saucer underneath doesn't house standing water.
If cutting back on water doesn't clear up the problem, repot the plant with new, sterile potting soil, gently removing as much of the old soil as possible without decimating the roots. Adult fungus gnats can also be trapped on yellow or blue sticky cards placed an inch or two above the soil surface.