Polypharmacy is common among patients taking prescription opioids long‐term, and the codispensing of interacting medications may further increase opioid overdose risk. To identify nonopioid medications that may increase opioid overdose risk in this population, we conducted a case‐crossover‐based screening of electronic claims data from IBM MarketScan and Optum Clinformatics Data Mart spanning 2003 through 2019. Eligible patients were 18 years of age or older and had at least 180 days of continuous enrollment and 90 days of prescription opioid use immediately before an opioid overdose resulting in an emergency room visit or hospitalization. The main analysis quantified the odds ratio (OR) between opioid overdose and each nonopioid medication dispensed in the 90 days immediately before the opioid overdose date after adjustment for prescription opioid dosage and benzodiazepine codispensing. Additional analyses restricted to patients without cancer diagnoses and individuals who used only oxycodone for 90 days immediately before the opioid overdose date. The false discovery rate (FDR) was used to account for multiple testing. We identified 24,866 individuals who experienced opioid overdose. Baclofen (OR 1.56; FDR < 0.01; 95% confidence interval (CI), 1.29 to 1.89), lorazepam (OR 1.53; FDR < 0.01; 95% CI, 1.25 to 1.88), and gabapentin (OR 1.16; FDR = 0.09; 95% CI, 1.04 to 1.28), among other nonopioid medications, were associated with opioid overdose. Similar patterns were observed in noncancer patients and individuals who used only oxycodone. Interventions may focus on prescribing safer alternatives when a potential for interaction exists.