Cold stimulation is the most common stressor in cold regions. Continuous cold stimulation can cause a series of pathophysiological changes in the body, such as aggregated neutrophils, macrophage activation, and increased inflammatory factors, which is also a risk factor for erectile function impairment. In addition, necroptosis is an important form of programmed cell death. However, the mechanisms of necroptosis in erectile function impairment due to cold stimulation have been very poorly studied. Therefore, we explored the mechanism of tumor necrosis factor-α (TNF-α)-mediated receptor interacting protein kinase 1 (RIP1)/receptor interacting protein kinase 3 (RIP3) necroptosis pathway on erectile function among cold-stressed rats. First, we established a cold-stressed rat model using cold stimulation and selected those rats that had developed erectile function impairment. Then, we used Necrostatin-1 (RIP1 specific inhibitor, Nec-1), Etanercept (TNF-α inhibitor, Ent), and Sildenafil (Sil) to intervene for 14 days and subsequently assessed their erectile function by apomorphine test and sexual behavioural test. Lastly, we performed various molecular studies and histopathological analyses of penile tissues collected from these rats after the experiments. We found that erectile function was impaired in cold-stressed rats, with increased penile tissue fibrosis and elevated levels of TNF-α and necroptosis. Contrastingly, intervention with Nec-1 and Ent restored erectile function, reduced penile tissue fibrosis, and decreased TNF-α and necroptosis levels, consistent with the results of intervention with Sil. Based on these results, we confirmed that the TNF-α-mediated RIP1/RIP3 necroptosis pathway was significantly altered in cold-stressed rats. In conclusion, inhibition of the TNF-α-mediated RIP1/RIP3 necroptosis pathway improved erectile function, suggesting that the specific downstream mechanisms need to be further explored.