Conditioned place preference (CPP) is a widely used model of addiction-related behavior whose underlying mechanisms are not understood. We used dual-site silicon optoprobe recordings in freely moving mice to examine interactions between the hippocampus and nucleus accumbens in cocaine CPP. We found that CPP was associated with recruitment of D2-positive nucleus accumbens medium spiny neurons to fire in the cocaine-paired location, and this recruitment was driven predominantly by selective strengthening of coupling with hippocampal place cells that encode the cocaine-paired location. These findings suggest that the synaptic potentiation in the accumbens caused by repeated cocaine administration preferentially affects inputs that were active at the time of drug exposure and provide a potential physiological mechanism by which drug use becomes associated with specific environmental contexts.