Benign prostatic hyperplasia (BPH) is one of the most prevalent conditions among aged men. The use of 5α-reductase inhibitors (5-ARIs) to treat BPH was linked to erectile dysfunction (ED). Many medicinal plants and secondary metabolites are used in the management of ED. Onion (Allium cepa L.) is an economically affordable vegetable with vital phytochemicals and biological functions. The study aimed to identify the beneficial effects of onion juice on dutasteride (a 5-ARI)-induced ED. Rats were divided into two groups (n = 5 per group): control and dutasteride-treated rats (0.5 mg/kg/day). Dutasteride was administered in drinking water for 12 weeks. Experiments were performed at the end of the 12th week. In vivo erectile responses were measured before and after intracavernosal injection of onion. Relaxant responses to onion juice were examined in the corpus cavernosum (CC). Acetylcholine (ACh)-, electrical field stimulation (EFS)-, sodium nitroprusside (SNP)-induced relaxation responses in CC tissues were evaluated in the absence and presence of onion juice. Total intracavernosal pressure (ICP) and ICP/ mean arterial pressure were significantly reduced in dutasteride-treated rats (1881.14 ± 249.72 mmHg, P < 0.001;0.26 ± 0.03, P < 0.01) as compared to control rats (4542.60 ± 429.19 mmHg, 0.51 ± 0.05), which was normalized after the intracavernous administration of onion (3288.60 ± 185.45 mmHg, 0.58 ± 0.04). Onion markedly induced relaxant responses in control (72.5 ± 4.7) and dutasteride-treated (66.5 ± 2.7) groups after precontraction with phenylephrine. Relaxation responses to onion were partially inhibited after precontraction with KCl (32.5 ± 3.1, P < 0.001). The relaxant responses to ACh (14.9 ± 4.2, P < 0.01) were diminished in dutasteride-treated CC) compared to control CC (59.8 ± 3.4), which was enhanced after the incubation with onion (36.6 ± 4.8). There were no differences in relaxation response to SNP among all groups. However, relaxation response to SNP was reduced in dutasteride-treated CC at 1 μM (P < 0.05) and 10 μM dosages (P < 0.001), which was partially increased after the incubation with onion at 10 μM dosage (P < 0.01). The presence of onion did not change the reduction in EFS-caused relaxation in the dutasteride-treated group. The current data suggest that red onion juice has a restorative effect on erectile function and endothelium-dependent relaxation response following the treatment of dutasteride.