The fruitfly Drosophila melanogaster exhibits a robust and innate olfactory-based avoidance behaviour to CO(2), a component of odour emitted from stressed flies. Specialized neurons in the antenna and a dedicated neuronal circuit in the higher olfactory system mediate CO(2) detection and avoidance. However, fruitflies need to overcome this avoidance response in some environments that contain CO(2) such as ripening fruits and fermenting yeast, which are essential food sources. Very little is known about the molecular and neuronal basis of this unique, context-dependent modification of innate olfactory avoidance behaviour. Here we identify a new class of odorants present in food that directly inhibit CO(2)-sensitive neurons in the antenna. Using an in vivo expression system we establish that the odorants act on the Gr21a/Gr63a CO(2) receptor. The presence of these odorants significantly and specifically reduces CO(2)-mediated avoidance behaviour, as well as avoidance mediated by 'Drosophila stress odour'. We propose a model in which behavioural avoidance to CO(2) is directly influenced by inhibitory interactions of the novel odours with CO(2) receptors. Furthermore, we observe differences in the temporal dynamics of inhibition: the effect of one of these odorants lasts several minutes beyond the initial exposure. Notably, animals that have been briefly pre-exposed to this odorant do not respond to the CO(2) avoidance cue even after the odorant is no longer present. We also show that related odorants are effective inhibitors of the CO(2) response in Culex mosquitoes that transmit West Nile fever and filariasis. Our findings have broader implications in highlighting the important role of inhibitory odorants in olfactory coding, and in their potential to disrupt CO(2)-mediated host-seeking behaviour in disease-carrying insects like mosquitoes.