Women have a higher prevalence of chronic noncancer pain conditions and report more severe pain, yet, it is not known if the association between long-term opioid analgesic use (OAU) and risk of a new depression episode (NDE) differs according to gender. We analyzed patient data from the Veterans Health Administration (VHA; 2000–2012; n = 70,997) and a large private-sector health care organization (2003–2012; n = 22,981) to determine whether long-term OAU and risk of NDE differed according to gender. Patients were free of depression and OAU for 2 years before baseline. OAU duration was defined as 1 to 30, 31 to 90 and more than 90 days, and NDE was defined according to International Classification of Diseases, Ninth Revision codes. Gender-stratified Cox proportional hazard models were used to estimate hazard ratios (HRs). Propensity scores and subsequent inverse probability of treatment weighting controlled for confounding. In the VHA, more than 90 compared with 1- to 30-day OAU was more strongly associated with NDE among female than male patients (female: HR = 1.79 [95% confidence interval (CI), 1.45–2.22] vs male HR = 1.25 [95% CI, 1.16–1.34], P =.002). In private sector patients, there was no gender difference in the association between more than 90-day OAU and NDE (female HR = 1.97 [95% CI, 1.64–2.37] vs male HR = 1.99 [95% CI, 1.44–2.74]). Risk of NDE after long-term OAU is similar in men and women in private sector patients but may differ for VHA patients. Future prospective studies are needed to identify mechanisms for the association between longer OAU and NDE. Perspective Existing research is mixed regarding gender differences in outcomes after long-term prescription opioid use. This study found both genders have increased risk of an NDE after more than 90 days of opioid use. Women and men may benefit from closer monitoring of mood associated with chronic opioid use.