Relatively little is known about genetic determinants of cognitive dysfunction in multiple sclerosis (MS). A growing body of evidence demonstrates that a functional variant of the brain-derived neurotrophic factor (BDNF) gene, the Val66Met polymorphism, contributes to poor hippocampal and prefrontal functions, particularly memory processes, in healthy controls. In contrast, findings from previous association studies examining this polymorphism and memory performance in MS patients yielded conflicting results. However, the way in which this BDNF polymorphism affects brain function in MS patients has not been examined. In line with the “intermediate phenotype” approach, we assessed effects of the BDNF Val66Met polymorphism on brain activity during a spatial working memory task. We used functional magnetic resonance imaging (fMRI) to measure brain responses in a total of 61 subjects comprising 29 relapsing–remitting MS patients and 32 healthy controls. The fMRI results demonstrated association of the BDNF polymorphism with brain activity during working memory, with opposite effects in MS patients and controls. Healthy carriers of the Met66 allele showed increased activation of the parieto-prefrontal network and altered disengagement of the ventro-medial prefrontal cortex and hippocampus in comparison with their respective Val66 counterparts. Analysis within the group demonstrated that this working memory-related activation pattern was absent in MS patients. Our imaging genetic study demonstrates that the Val66Met polymorphism of the BDNF gene contributes to some of the individual variability in the functional response to a working memory challenge in healthy controls but it does not provide evidence for an MS-specific pattern of gene action.