Rat nerve growth factor and total flavonoids from hawthorn leaf contribute to the recovery of neurological function after spinal cord injury, including traumatic, non-traumatic spinal cord injuries. However, it remains challenging to efficiently deliver nerve growth factor and total flavonoids from hawthorn leaf to spinal cord injury sites, ensure their sustained release, and minimize further damage. In the present study, we chose a biocompatible and biodegradable gelatin as the substrate, which was crosslinked with the natural biological crosslinker genipin to form a gelatin-genipin hydrogel carrier for the slow release of nerve growth factor and total flavonoids from hawthorn leaf in spinal cord injury sites. The prepared gelatin-genipin hydrogel had good injectable properties and photothermal effects. Furthermore, when the hydrogel with 2% genipin, 200 ng/mL nerve growth factor, and 320 μg/mL total flavonoids from hawthorn leaf was combined with near infrared irradiation, there was a slow release of total flavonoids from hawthorn leaf and nerve growth factor, reduced oxidative stress, an improved inflammatory microenvironment, and accelerated angiogenesis and axonal regeneration via inhibition of the nuclear factor kappa-B signaling pathway, thereby promoting recovery from spinal cord injury. Collectively, our results indicate that this new hydrogel may improve the prognosis of spinal cord injury, and may represent a new strategy for treating spinal cord injury.