Childhood abuse and neglect (CAN) is considered as a risk factor for substance use disorder (SUD). Based on the drinking to cope model, this study investigated the association of two trauma-relevant emotions (shame and sadness) and substance use. Using ecological momentary assessment we compared real-time emotion regulation in situations with high and low intensity of shame and sadness in currently abstinent patients with CAN and lifetime SUD (traumaSUD group), healthy controls with CAN (traumaHC group), and without CAN (nontraumaHC group). Multilevel analysis showed a positive linear relationship between high intensity of both emotions and substance use for all groups. The traumaSUD group showed heightened substance use in low, as well as in high, intensity of shame and sadness. In addition, we found an interaction between type of emotion, intensity, and group: the traumaHC group exhibited a fourfold increased risk for substance use in high intense shame situations relative to the traumaSUD group. Our findings provide evidence for the drinking to cope model. The traumaSUD group showed a reduced distress tolerance for variable intensity of negative emotions. The differential effect of intense shame for the traumaHC group emphazises its potential role in the development of SUD following CAN. In addition, shame can be considered a relevant focus for therapeutic preinterventions and interventions for SUD after CAN.