Alterations in frontal and parietal neural activations during working memory task performance have been suggested as a candidate endophenotype of obsessive-compulsive disorder (OCD) in studies involving first-degree relatives. However, the direct link between genetic risk for OCD and neuro-functional alterations during working memory performance has not been investigated to date. Thus, the aim of the current functional magnetic resonance imaging (fMRI) study was to test the direct association between polygenic risk for OCD and neural activity during the performance of a numeric n-back task with four working memory load conditions in 128 participants, including patients with OCD, unaffected first-degree relatives of OCD patients, and healthy controls. Behavioral results show a significant performance deficit at high working memory load in both patients with OCD and first-degree relatives (p < 0.05). A whole-brain analysis of the fMRI data indicated decreased neural activity in bilateral inferior parietal lobule and dorsolateral prefrontal cortex in both patients and relatives. Most importantly, OCD polygenic risk scores predicted neural activity in orbitofrontal cortex. Results indicate that genetic risk for OCD can partly explain alterations in brain response during working memory performance, supporting the notion of a neuro-functional endophenotype for OCD.