Repeated exposure to cocaine alters the structural and functional properties of medium spiny neurons (MSNs) in the nucleus accumbens (NAc). These changes suggest a rewiring of the NAc circuit, with an enhancement of excitatory synaptic connections onto MSNs. However, it is unknown how drug exposure alters the balance of long-range afferents onto different cell types in the NAc. Here we used whole-cell recordings, two-photon microscopy, optogenetics and pharmacogenetics to show how repeated cocaine exposure alters connectivity in the mouse NAc medial shell. Cocaine selectively enhanced amygdala innervation of MSNs expressing D1 dopamine receptors (D1-MSNs) relative to D2-MSNs. We also found that amygdala activity was required for cocaine-induced changes to behavior and connectivity. Finally, we established how heightened amygdala innervation can explain the structural and functional changes evoked by cocaine. Our findings reveal how exposure to drugs of abuse fundamentally reorganizes cell type- and input-specific connectivity in the NAc.