Behaviour-modifying drugs like antidepressants are increasingly being detected in waterways and aquatic wildlife tissues around the world. Typically, behavioural effects of these contaminants are assessed using single animals tested in social isolation. However, for group-living species, effects seen in isolation may not reflect those occurring in a realistic social setting. Further, interactions between chemical pollution and other stressors, such as predation risk, are seldom considered. This is true even though animals in the wild are rarely, if ever, confronted by chemical pollution as a single stressor. Here, in a two-year, multigenerational experiment, we tested for effects of the antidepressant fluoxetine (nominal concentrations: 0, 30 and 300 ng/L) on shoaling behaviour in guppies (Poecilia reticulata) across different social contexts and under varying levels of predation risk. Shoaling propensity and shoal choice were assessed in the presence of a predatory or non-predatory heterospecific, with guppies tested individually and in male–female pairs. When tested individually, no effect of fluoxetine was seen on shoaling behaviour. However, in paired trials, high-fluoxetine exposed fish exhibited a significantly greater shoaling propensity. Hence, effects of fluoxetine were mediated by social context, highlighting the importance of this fundamental but rarely considered factor when evaluating impacts of environmental pollution.