I don't see it happening. I somehow got fruit flies in the soil of our vailed's enclosure. He doesn't even notice them. If you introduce fruit flies to your enclosure and have life plants in pots or a bioactive setup like I do, you will have a living colony. The only way to get rid of them is to spray with pesticides, which you would not want to do with your chameleon in there...
I would not recommend it.
I think you have soil/fungus gnats. I've never seen fruit flies go into the soil. And there are methods outside of pesticides for clearing them out.