There is growing evidence that heterozygosity–fitness correlations (HFCs) are more pronounced under harsh conditions. Empirical evidence suggests a mediating effect of parasite infestation on the occurrence of HFCs. Parasites have the potential to mediate HFCs not only by generally causing high stress levels but also by inducing resource allocation tradeoffs between the necessary investments in immunity and other costly functions. To investigate the relative importance of these two mechanisms, we manipulated growth conditions of great tit nestlings by brood size manipulation, which modifies nestling competition, and simultaneously infested broods with ectoparasites. We investigated under which treatment conditions HFCs arise and, second, whether heterozygosity is linked to tradeoff decisions between immunity and growth. We classified microsatellites as neutral or presumed functional and analyzed these effects separately. Neutral heterozygosity was positively related to the immune response to a novel antigen in parasite-free nests, but not in infested nests. For nestlings with lower heterozygosity levels, the investments in immunity under parasite pressure came at the expenses of reduced feather growth, survival, and female body condition. Functional heterozygosity was negatively related to nestling immune response regardless of the growth conditions. These contrasting effects of functional and neutral markers might indicate different underlying mechanisms causing the HFCs. Our results confirm the importance of considering marker functionality in HFC studies and indicate that parasites mediate HFCs by influencing the costs of immune defense rather than by a general increase in environmental harshness levels.