Yes, in theory. Cinnamon is a natural fungicide but whether it can effectively repel fungus gnats remains debatable. If you want to give it a shot, simply sprinkle a layer of cinnamon around the plant when the soil is dry.