Nonylphenol (NP), causes various harmful effects such as cognitive impairment and neurotoxicity. Thymoquinone (TQ), has antioxidant, anti‐inflammatory, and neuroprotective properties. In this study, our aim is to investigate the effects of TQ on the brain damage caused by NP. Corn oil was applied to the control group. NP (100 mg/kg/day) was administered to the NP and NP + TQ groups for 21 days. TQ (5 mg/kg/day) was administered to the NP + TQ and TQ groups for 7 after 21 days. At the end of the experiment, the new object recognition test was applied to the rats and the rats were killed and their brain tissues were removed. Sections taken from brain tissues were stained with hematoxylin–eosin for histopathological evaluation. In addition, neuronal nuclei (NeuN), glial fibrillary acidic protein (GFAP), Cas‐3, and nerve growth factor (NGF) immunoreactivities were evaluated in brain tissue sections. In addition, malondialdehyde (MDA), superoxide dismutase (SOD), and catalase (CAT) activities were determined. Comet assay was applied to determine DNA damage in cells. The results of our study showed that NP, caused behavioral disorders and damage to the cerebral cortex in rats. This damage in the form of neuron degeneration seen in the cortex was associated with apoptosis involving Cas‐3 activation, increased DNA damage, and free oxygen radicals. NP, SOD, and CAT caused a decrease in enzyme activities. In addition, the cellular protein NeuN was decreased, astrocytosis‐associated GFAP was increased, and growth factor NGF was decreased. When all our evaluations are taken together, treatment with TQ showed an ameliorative effect on the behavioral impairment and brain damage caused by NP exposure.