HIV-encoded DNA, RNA and proteins persist in the brain despite effective antiretroviral therapy (ART), with undetectable plasma and cerebrospinal fluid viral RNA levels, often in association with neurocognitive impairments. Although the determinants of HIV persistence have garnered attention, the expression and regulation of antiretroviral host restriction factors (RFs) in the brain for HIV and SIV remain unknown. We investigated the transcriptomic profile of antiretroviral RF genes by RNA-sequencing with confirmation by qRT-PCR in the cerebral cortex of people who are uninfected (HIV[-]), those who are HIV-infected without pre-mortem brain disease (HIV[+]), those who are HIV-infected with neurocognitive disorders (HIV[+]/HAND) and those with neurocognitive disorders with encephalitis (HIV[+]/HIVE). We observed significant increases in RF expression in the brains of HIV[+]/HIVE in association with the brain viral load. Machine learning techniques identified MAN1B1 as a key gene that distinguished the HIV[+] group from the HIV[+] groups with HAND. Analyses of SIV-associated RFs in brains from SIV-infected Chinese rhesus macaques with different ART regimens revealed diminished RF expression among ART-exposed SIV-infected animals, although ART interruption resulted in an induced expression of several RF genes including OAS3, RNASEL, MX2 and MAN1B1. Thus, the brain displays a distinct expression profile of RFs that is associated with the neurological status as well as the brain viral burden. Moreover, ART interruption can influence the brain's RF profile, which might contribute to disease outcomes.