Depression is a prevalent psychiatric disorder with accumulating evidence implicating dysregulation of extracellular adenosine triphosphate (ATP) levels in the medial prefrontal cortex (mPFC). It remains unclear whether facilitating endogenous ATP production and subsequently increasing extracellular ATP level in the mPFC can exert a prophylactic effect against chronic social defeat stress (CSDS)-induced depressive-like behaviors and enhance stress resilience. Here, we found that nicotinamide mononucleotide (NMN) treatment effectively elevated nicotinamide adenine dinucleotide (NAD+) biosynthesis and extracellular ATP levels in the mPFC. Moreover, both the 2-week intraperitoneal (i.p.) injection and 3-week oral gavage of NMN prior to exposure to CSDS effectively prevented the development of depressive-like behavior in mice. These protective effects were accompanied with the preservation of both NAD+ biosynthesis and extracellular ATP level in the mPFC. Furthermore, catalyzing ATP hydrolysis by mPFC injection of the ATPase apyrase negated the prophylactic effects of NMN on CSDS-induced depressive-like behaviors. Prophylactic NMN treatment also prevented the reduction in GABAergic inhibition and the increase in excitability in mPFC neurons projecting to the lateral habenula (LHb). Collectively, these findings demonstrate that the prophylactic effects of NMN on depressive-like behaviors are mediated by preventing extracellular ATP loss in the mPFC, which highlights the potential of NMN supplementation as a novel approach for protecting and preventing stress-induced depression in susceptible individuals.