Abstract Drug addiction is characterized by a sustained vulnerability to relapse even after long periods of abstinence. A deeper understanding of the brain systems underlying this state could inform therapeutic strategies with novel prognostic biomarkers aimed at preventing renewed drug seeking. Most drugs of abuse, in particular psychostimulants such as cocaine, lead to long-lasting mesolimbic dopamine system adaptations, that ultimately facilitate drug seeking following exposure to drug-paired cues. This “dopaminergic hypothesis” of relapse has been previously addressed, but technical limitations in measuring in vivo dopamine release have precluded the assessment of its sufficiency without introducing pharmacological, electrical, or optogenetic confounds. Using a dopamine receptor-based fluorescent sensor in freely moving mice, we show that long-lasting dopamine recordings in the nucleus accumbens (NAc), throughout the animal’s entire history of cocaine self-administration, are strong predictors of relapse as well as the time it takes an animal to extinguish its drug seeking behavior. Moreover, we reveal previously unseen sex-specific trajectories of cocaine-related phasic dopamine responses from acquisition to relapse. We show that males exhibit higher-amplitude phasic dopamine responses, a trait accompanied by a greater resistance to extinguish their cocaine seeking, compared to females. Furthermore, we show that a semi-parametric model of the transition to extinction – using only multivariate patterns of dopamine release and sex as covariates – faithfully recapitulates male-specific vulnerability to persistent cocaine seeking. In conclusion, we present a predictive model of reinstatement behavior that uses information exclusively conveyed by NAc phasic dopamine responses, thus confirming, and actuating the sufficiency of the dopaminergic hypothesis of relapse.