The main hosts of the melon fly Zeugodacus cucurbitate are cultivated and wild cucurbitaceous plants. In eastern Africa, the melon fly is a major pest of the Solanaceae plant Solanum lycopersicum (tomato). We hypothesized that shared species-specific volatiles may play a role in host attraction. We tested this hypothesis by comparing the olfactory responses of the melon fly to Cucumis sativus (cucumber) (Cucurbitaceae) and tomato plant odors in behavioral and electrophysiological assays, followed by chemical analysis to identify the key compounds mediating the interactions. Our results identified 13 shared components between cucumber and tomato plant odors. A synthetic blend of seven of the shared components dominated by monoterpenes at concentrations mimicking the volatile bouquet of cucumber and tomato attracted both sexes of the melon fly. Our results suggest that the presence and quantity of specific compounds in host odors are the main predictors for host recognition in Z. cucurbitate.