Axons damaged by acute injury, toxic insults, or during neurodegenerative diseases undergo Wallerian or Wallerian-like degeneration, which is an active and orderly cellular process, but the underlying mechanisms are poorly understood. Drosophila has been proven to be a successful system for modeling human neurodegenerative diseases. In this study, we established a novel in vivo model of axon injury using the adult fly wing. The wing nerve highlighted by fluorescent protein markers can be directly visualized in living animals and be precisely severed by a simple wing cut, making it highly suitable for large-scale screening. Using this model, we confirmed an axonal protective function of Wld(S) and nicotinamide mononucleotide adenylyltransferase (Nmnat). We further revealed that knockdown of endogenous Nmnat triggered spontaneous, dying-back axon degeneration in vivo. Intriguingly, axonal mitochondria were rapidly depleted upon axotomy or downregulation of Nmnat. The injury-induced mitochondrial loss was dramatically suppressed by upregulation of Nmnat, which also protected severed axons from degeneration. However, when mitochondria were genetically eliminated from axons, upregulation of Nmnat was no longer effective to suppress axon degeneration. Together, these findings demonstrate an essential role of endogenous Nmnat in maintaining axonal integrity that may rely on and function by stabilizing mitochondria.