We recently reported that the serotonin transporter polymorphism 5-HTTLPR moderates the relation between stress exposure and attention-deficit/hyperactivity disorder (ADHD) severity. This gene-environment interaction (GxE) has been previously tied to the processing of emotional stimuli, which is increasingly recognized to be a key factor in ADHD-related impairment. The executive control and default mode brain networks play an important role in the regulation of emotion processing, and altered connectivity of these networks has also been associated with ADHD. We therefore investigated whether resting-state connectivity of either of these networks mediates the relation of 5-HTTLPR and stress exposure with ADHD severity. Resting-state functional magnetic resonance imaging, genetic, and stress exposure questionnaire data was available for 425 adolescents and young adults (average age 17.2 years). We found that 5-HTTLPR S-allele carriers showed a more negative relation between stress exposure and connectivity of the executive control network than L-allele homozygotes, specifically in the pre/postcentral gyrus, striatum, and frontal pole. In the default mode network, we found a positive association between the GxE and supramarginal gyrus connectivity. Connectivity of either network did not significantly mediate the effect of this GxE on ADHD. Opposite effects of stress exposure on connectivity in the executive and default mode networks may contribute to findings that stress exposure is associated with lowered cognitive control and heightened levels of rumination and worrying, for S-allele carriers but not L-allele homozygotes. When combined, these effects on connectivity of both networks may relate to the emotional problems seen in individuals with ADHD.