Knowing the site of drug action is important to optimize effectiveness and address any side effects. We used light-sensitive drugs to identify the brain region-specific role of mGlu5 metabotropic glutamate receptors in the control of pain. Optical activation of systemic JF-NP-26, a caged, normally inactive, negative allosteric modulator (NAM) of mGlu5 receptors, in cingulate, prelimbic and infralimbic cortices and thalamus inhibited neuropathic pain hypersensitivity. Systemic treatment of alloswitch-1, an intrinsically active mGlu5 receptor NAM, caused analgesia, and the effect was reversed by light-induced drug inactivation in in the prelimbic and infralimbic cortices, and thalamus. This demonstrates that mGlu5 receptor blockade in the medial prefrontal cortex and thalamus is both sufficient and necessary for the analgesic activity of mGlu5 receptor antagonists. Surprisingly, when light was delivered in the basolateral amygdala, local activation of systemic JF-NP-26 reduced pain thresholds, whereas inactivation of alloswitch-1 enhanced analgesia. Electrophysiological analysis showed that alloswitch-1 increased excitatory synaptic responses in prelimbic pyramidal neurons evoked by stimulation of BLA input, and decreased feedforward inhibition of amygdala output neurons by BLA. Both effects were reversed by optical silencing and reinstated by optical reactivation of alloswitch-1. These findings demonstrate for the first time that the action of mGlu5 receptors in the pain neuraxis is not homogenous, and suggest that blockade of mGlu5 receptors in the BLA may limit the overall analgesic activity of mGlu5 receptor antagonists. This could explain the suboptimal effect of mGlu5 NAMs on pain in human studies and validate photopharmacology as an important tool to determine ideal target sites for systemic drugs.