Tissue-resident memory CD8 T (TRM) cells defend against microbial reinfections at mucosal barriers; determinants driving durable TRM cell responses in non-mucosal tissues, which often harbor opportunistic persistent pathogens, are unknown. JC polyomavirus (JCPyV) is a ubiquitous constituent of the human virome. With altered immunological status, JCPyV can cause the oft-fatal brain demyelinating disease progressive multifocal leukoencephalopathy (PML). JCPyV is a human-only pathogen. Using the mouse polyomavirus (MuPyV) encephalitis model, we demonstrate that CD4 T cells regulate development of functional antiviral brain-resident CD8 T cells (bTRM) and renders their maintenance refractory to systemic CD8 T cell depletion. Acquired CD4 T cell deficiency, modeled by delaying systemic CD4 T cell depletion until MuPyV-specific CD8 T cells have infiltrated the brain, impacted the stability of CD8 bTRM, impaired their effector response to reinfection, and rendered their maintenance dependent on circulating CD8 T cells. This dependence of CD8 bTRM differentiation on CD4 T cells was found to extend to encephalitis caused by vesicular stomatitis virus. Together, these findings reveal an intimate association between CD4 T cells and homeostasis of functional bTRM to CNS viral infection.