M5 muscarinic acetylcholine receptors expressed on ventral tegmental dopamine (DA) neurons are needed for opioid activation of DA outputs. Here, the M5 receptor gene was bilaterally transfected into neurons in the ventral tegmental area (VTA) or the adjacent rostromedial tegmental nucleus (RMTg) in mice by means of a Herpes simplex viral vector (HSV) to increase the effect of endogenous acetylcholine. Three days after HSV-M5 gene infusion in VTA sites, morphine-induced locomotion more than doubled at two doses, while saline-induced locomotion was unaffected. When the HSV-M5 gene was infused into the adjacent RMTg, morphine-induced locomotion was strongly inhibited. The sharp boundary between these opposing effects was found where tyrosine hydroxylase (TH) and cholinesterase labelling decreases (-4.00mm posterior to bregma). The same HSV-M5 gene transfections in M5 knockout mice induced even stronger inhibitory behavioural effects in RMTg but more variability in VTA sites due to stereotypy. The VTA sites where HSV-M5 increased morphine-induced locomotion receive direct inputs from many RMTg GAD-positive neurons, and from pontine ChAT-positive neurons, as shown by cholera-toxin B retrograde tracing. Therefore, morphine-induced locomotion was decreased by M5 receptor gene expression in RMTg GABA neurons that directly inhibit VTA DA neurons. Conversely, enhancing M5 receptor gene expression on VTA DA neurons increased morphine-induced locomotion via cholinergic inputs.