The dorsal and ventral attention networks (DAN & VAN) provide a framework for studying attentional modulation of pain. It has been argued that cognitive demand distracts attention from painful stimuli via top-down reinforcement of task goals (DAN), whereas pain exerts an interruptive effect on cognitive performance via bottom-up pathways (VAN). The current study explores this explanatory framework by manipulating pain and task demand in combination with functional near-infrared spectroscopy (fNIRS) and Granger Causal Connectivity Analyses (GCCA). Twenty-one participants played a racing game at low and high difficulty levels with or without experimental pain (administered via a cold pressor test). Six channels of fNIRS were collected from bilateral frontal eye fields and intraparietal sulci (DAN), with right-lateralised channels at the inferior frontal gyrus and temporoparietal junction (VAN). Our first analysis revealed increased G-causality from bottom-up pathways (VAN) during the cold pressor test. However, an equivalent experience of experimental pain during gameplay increased G-causality in top-down (DAN) pathways, with the left intraparietal sulcus serving a hub of connectivity. High game difficulty increased G-causality via top-down pathways and implicated the right inferior frontal gyrus as an interhemispheric hub. Our results are discussed with reference to existing models of both networks and attentional modulation of pain.