The spotted‐wing drosophila, Drosophila suzukii and the cosmopolitan vinegar fly D. melanogaster feed on soft fruit and berries and widely overlap in geographic range. The presence of D. melanogaster reduces egg‐laying in D. suzukii, possibly because D. melanogaster outcompetes D. suzukii larvae feeding in the same fruit substrate. Flies use pheromones to communicate for mating, but pheromones also serve a role in reproductive isolation between related species. We asked whether a D. melanogaster pheromone also modulates oviposition behaviour in D. suzukii. A dual‐choice oviposition assay confirms that D. suzukii lays fewer eggs on blueberries exposed to D. melanogaster flies and further shows that female flies have a stronger effect than male flies. This was corroborated by treating berries with synthetic pheromones. Avoidance of D. suzukii oviposition is mediated by the female D. melanogaster pheromone (Z)‐4‐undecenal (Z4‐11Al). Significantly fewer eggs were laid on berries treated with synthetic Z4‐11Al. In comparison, the male pheromone (Z)‐11‐octadecenyl acetate (cVA) had no effect on D. suzukii oviposition. Z4‐11Al is a highly volatile compound that is perceived via olfaction and it is accordingly behaviourally active at a distance from the source. D. suzukii is known to engage in mutual niche construction with the yeast Hanseniaspora uvarum, which strongly attracts flies. Adding Z4‐11Al to fermenting H. uvarum significantly decreased D. suzukii flight attraction in a laboratory wind tunnel and a field trapping assay. That a D. melanogaster pheromone regulates oviposition in D. suzukii demonstrates that heterospecific pheromone communication contributes to reproductive isolation and resource partitioning in cognate species. Stimulo‐deterrent diversion or push‐pull methods, building on combined use of attractant and deterrent compounds, have shown promise for control of D. suzukii. A pheromone that specifically reduces D. suzukii attraction and oviposition adds to the toolbox for D. suzukii integrated management.