The pain matrix is comprised of an extensive network of brain structures involved in sensory and/or affective information processing. The thalamus is a key structure constituting the pain matrix. The thalamus serves as a relay center receiving information from multiple ascending pathways and relating information to and from multiple cortical areas. However, it is unknown how thalamocortical networks specific to sensory-affective information processing are functionally integrated. Here, in a proof-of-concept study in healthy humans, we aimed to understand this connectivity using transcranial direct current stimulation (tDCS) targeting primary motor (M1) or dorsolateral prefrontal cortices (DLPFC). We compared changes in functional connectivity (FC) with DLPFC tDCS to changes in FC with M1 tDCS. FC changes were also compared to further investigate its relation with individual's baseline experience of pain. We hypothesized that resting-state FC would change based on tDCS location and would represent known thalamocortical networks. Ten right-handed individuals received a single application of anodal tDCS (1 mA, 20 min) to right M1 and DLPFC in a single-blind, shamcontrolled crossover study. FC changes were studied between ventroposterolateral (VPL), the sensory nucleus of thalamus, and cortical areas involved in sensory information processing and between medial dorsal (MD), the affective nucleus, and cortical areas involved in affective information processing. Individual's perception of pain at baseline was assessed using cutaneous heat pain stimuli. We found that anodal M1 tDCS and anodal DLPFC tDCS both increased FC between VPL and sensorimotor cortices, although FC effects were greater with M1 tDCS. Similarly, anodal M1 tDCS and anodal DLPFC tDCS both increased FC between MD and motor cortices, but only DLPFC tDCS modulated FC between MD and affective cortices, like DLPFC. Our findings suggest that M1 stimulation primarily modulates FC of sensory networks, whereas DLPFC stimulation modulates FC of both sensory and affective networks. Our findings when replicated in a larger group of individuals could provide useful evidence that may inform future studies on pain to differentiate between effects of M1 and DLPFC stimulation. Notably, our finding that individuals with high baseline pain thresholds experience greater FC changes with DLPFC tDCS implies the role of DLPFC in pain modulation, particularly pain tolerance.