We found thatDrosophilaspecies vary in their susceptibility to the broad-spectrum entomopathogen,Metarhizium anisopliae(strain Ma549). Generalist species were generally more resistant than dietary specialists, with the cactophilicDrosophila buzzatiiandDrosophila sechellia,a specialist of theMorinda citrifolia(Morinda) fruit, being most susceptible. Morinda fruit is reported to be toxic to most herbivores because it contains Octanoic Acid (OA). We confirmed that OA is toxic toDrosophilaspp., other thanD. sechellia,and we also found that OA is highly toxic to entomopathogenic fungi including Ma549 andBeauveria bassiana.Drosophilasechelliafed a diet containing OA, even at levels much less than found in Morinda fruit, had greatly reduced susceptibility to Ma549. This suggests that specializing to Morinda may have provided an enemy-free space, reducing adaptive prioritization on a strong immune response. Our results demonstrate thatM. anisopliaeandDrosophilaspecies with divergent lifestyles provide a versatile model system for understanding the mechanisms of host–pathogen interactions at different scales and in environmental context.