The melanotic encapsulation response mounted by Drosophila melanogaster against macroparasites, which is based on haemocyte binding to foreign objects, is poorly characterized relative to its humoral immune response against microbes, and appears to be variable across insect lineages. The genus Zaprionus is a diverse clade of flies embedded within the genus Drosophila. Here we characterize the immune response of Zaprionus indianus against endoparasitoid wasp eggs, which elicit the melanotic encapsulation response in D. melanogaster. We find that Z. indianus is highly resistant to diverse wasp species. Although Z. indianus mounts the canonical melanotic encapsulation response against some wasps, it can also potentially fight off wasp infection using two other mechanisms: encapsulation without melanization and a non-cellular form of wasp killing. Zaprionus indianus produces a large number of haemocytes including nematocytes, which are large fusiform haemocytes absent in D. melanogaster, but which we found in several other species in the subgenus Drosophila. Several lines of evidence suggest these nematocytes are involved in anti-wasp immunity in Z. indianus and in particular in the encapsulation of wasp eggs. Altogether, our data show that the canonical anti-wasp immune response and haemocyte make-up of the model organism D. melanogaster vary across the genus Drosophila.