Dopamine modulates complex cognitive functions like working memory and cognitive control. It is widely accepted that an optimal level of prefrontal dopamine supports working memory performance. In the present study we used a molecular genetic approach to test whether the optimal activity of the dopamine system for different component processes of working memory is additionally related to the availability of dopamine D2 receptors. We sought evidence for this assumption by investigating the interaction effect (epistasis) of variations in two dopaminergic candidate genes: the catechol-O-methyltransferase (COMT) Val158Met polymorphism, which has been shown to influence prefrontal dopamine concentration, and the DRD2/ANKK1-Taq-Ia polymorphism, which has been related to the density of D2 receptors. Our results show that COMT effects on working memory performance are modulated by the DRD2/ANKK1-TAQ-Ia polymorphism and the specific working memory component process under investigation. Val− participants – supposedly characterized by increased prefrontal dopamine concentrations – outperformed Val+ participants in the manipulation of working memory contents, but only when D2 receptor density could be considered to be high. No such effect was present for passive maintenance of working memory contents or for maintenance in the face of distracting information. This beneficial effect of a balance between prefrontal dopamine availability and D2 receptor density reveals the importance of considering epistasis effects and different working memory subprocesses in genetic association studies.