Plants release complex volatile compounds to attract mutualists, deter herbivores, and deceive pollinators. Here, we used herbivorous specialist flies that feed on mustard plants ( Scaptomyza spp.) and microbe-feeding species ( Drosophila melanogaster and Scaptomyza spp.) to investigate how plant-derived electrophilic toxins such as isothiocyanates (ITCs) affect insects, and how flies detect these compounds through olfaction. In survival assays, D. melanogaster exposed to volatile allyl isothiocyanate (AITC), a toxin derived from many Brassicales plants, were acutely intoxicated, demonstrating the high toxicity of this volatile compound to non-specialized insects. Through single sensillum recordings (SSR) from olfactory organs and behavioral assays, we found that the Odorant receptor 42a (Or42a) is necessary for AITC detection and behavioral aversion. Comparative transcriptome and RNA FISH studies across the drosophilid genus Scaptomyza revealed lineage-specific triplication of Or42a in the Brassicales specialists and a doubling of Or42a -positive-olfactory sensory neurons. Heterologous expression experiments showed that Or42a paralogs in Brassicales-specialists exhibited broadened sensitivity to ITCs in a paralog-specific manner. Finally, AlphaFold2 modeling followed by site-directed mutagenesis and SSR identified two critical amino acid substitutions that conferred Or42a heighten sensitivity to Brassicales-derived ITCs. Our findings suggest that ITCs, which are toxic to most insects, can be detected and avoided by non-specialists like D. melanogaster through olfaction. In Brassicales specialists, these same Ors experienced gene duplication events that resulted in an expanded sensitivity to ITC compounds. Thus, the insect's olfactory system can rapidly adapt to toxic ecological niches provided by chemically-defended host plants through co-option of chemosensory capabilities already present in their ancestors.