Emotional experiences often evoke neural plasticity that supports adaptive changes in behavior, including maladaptive plasticity associated with mood and substance use disorders. These adaptations are supported in part by experience-dependent activation of immediate-early response genes, such as Npas4 (neuronal PAS domain protein 4). Here we show that a conserved long noncoding enhancer RNA (lnc-eRNA), transcribed from an activity-sensitive enhancer, produces DNA:RNA hybrid R-loop structures that support three-dimensional chromatin looping between enhancer and proximal promoter and rapid Npas4 gene induction. Furthermore, in mouse models, Npas4 lnc-eRNA and its R-loop are required for the development of behavioral adaptations produced by chronic psychosocial stress or cocaine exposure, revealing a potential role for this regulatory mechanism in the transmission of emotional experiences.