Glial scars formed after brain injuries provide permissive cues for endogenous neural precursor/stem cells (eNP/ SCs) to undergo astrogenesis rather than neurogenesis. Following brain injury, eNP/SCs from the subventricular zone leave their niche, migrate to the injured cortex, and differentiate into reactive astrocytes that contribute to glial scar formation. In vivo neuronal reprogramming, directly converting non-neuronal cells such as reactive astrocytes or NG2 glia into neurons, has greatly improved brain injury repair strategies. However, reprogramming carries a high risk of future clinical applications such as tumorigenicity, involving virus. In this study, we constructed a neural matrix to alter the adverse niche at the injured cortex, enabling eNP/SCs to differentiate into functional neurons. We found that the neural matrix functioned as a ''glial trap'' that largely concentrated and limited reactive astrocytes to the core of the lesion area, thus altering the adverse niche. The eNP/SCs migrated toward the injured cortex and differentiated into functional neurons. In addition, regenerated neurites extended across the boundary of the injured cortex. Mice treated with the neural matrix demonstrated significant behavioral recovery. For the first time, we induced eNP/SC-derived functional neurons in the cortex after brain injury without the use of viruses, microRNAs, or small molecules. Our novel strategy of applying this ''glial trap'' to obtain functional neurons in the injured cortex may provide a safer and more natural therapeutic alternative to reprogramming in future clinical applications.