Fumes from many volatile solvents can have a chloroform-type knocking-out effect on many animals. Being so volatile, they overwhelm quickly but also dissipate quickly (especially acetone). They are, after all, the same group of compounds that send us giddy and peculiar (not just ethanol but countless compounds favoured for so-called solvent abuse or ‘glue sniffing’) only to come round relatively rapidly and usually none the worse for wear.
In any case, I would be very cautious of spraying acetone around the place. As it damages the majority of plastics, it could cause untold permanent damage around the house and even to clothing etc.
If I wanted to kill gnats by spraying, I would be inclined to experiment with a spray along the lines of vinegar mixed with a dash of liquid soap.
Flies definitely do seem very hardy. RAID Fly & Wasp Killer spray wipes out wasps in seconds, but seems to take minutes to have any effect on most flies, if any at all. I would be interested to know the reason for this.