Diverse sensory organs, including mammalian taste buds and insect chemosensory sensilla, show a striking compartmentalization of receptor cells. However, the functional impact of this organization remains unclear. Here we show that compartmentalized Drosophila olfactory receptor neurons (ORNs) communicate with each other directly. The sustained response of one ORN is inhibited by the transient activation of a neighboring ORN. Mechanistically, such lateral inhibition does not depend on synapses and is likely mediated by ephaptic coupling. Moreover, lateral inhibition in the periphery can modulate olfactory behavior. Together, the results show that integration of olfactory information can occur via lateral interactions between ORNs. Inhibition of a sustained response by a transient response may provide a means of encoding salience. Finally, a CO 2-sensitive ORN in the malaria mosquito Anopheles can also be inhibited by excitation of an adjacent ORN, suggesting a broad occurrence of lateral inhibition in insects and possible applications in insect control.