Women with cocaine use disorder have worse treatment outcomes compared with men. Sex differences in cocaine addiction may be driven by differences in neurobiology or stress reactivity. Oxytocin is a potential therapeutic for stress reduction in substance use disorders, but no studies have examined the effect of oxytocin on neural response to drug cues in individuals with cocaine use disorders or potential sex differences in this response. The goal of this study was to examine the effect of intranasal oxytocin on cocaine cue reactivity in cocaine dependence, modulated by gender and history of childhood trauma. Cocaine-dependent men with (n = 24) or without (n = 19) a history of childhood trauma and cocaine-dependent women with (n = 16) or without (n = 8) a history of childhood trauma completed an fMRI cocaine cue reactivity task under intranasal placebo or oxytocin (40 IU) on two different days. fMRI response was measured in the right amygdala and dorsomedial prefrontal cortex (DMPFC). In the DMPFC, oxytocin reduced fMRI response to cocaine cues across all subject groups. However, in the amygdala, only men with a history of childhood trauma showed a significantly reduced fMRI response to cocaine cues on oxytocin versus placebo, while women with a history of childhood trauma showed an enhanced amygdala response to cocaine cues following oxytocin administration. Cocaine-dependent subjects with no history of childhood trauma showed no effect of oxytocin on amygdala response. Oxytocin can reduce cue reactivity in cocaine dependence, but its effect is modified by sex and childhood trauma history. Whereas men with cocaine dependence may benefit from oxytocin administration, additional studies are needed to determine whether oxytocin can be an effective therapeutic for cocaine-dependent women.