Oral administration of a food-derived amino acid ergothioneine (ERGO) enhances cognition in mice although molecular mechanisms remain unclear. Our comprehensive molecular targeting assays showed inhibition by ERGO of histamine N-methyltransferase (HNMT), a main histamine-metabolizing enzyme in the brain (J Funct Foods 95, 105165, 2022). We here attempted to characterize the inhibitory effect of ERGO on HNMT-induced methyl transfer from a methyl donor S-adenosyl-methionine (SAM) to histamine. A radioenzymatic assay using a [3H]SAM showed that mouse brain homogenate increased radioactivity of the [3H]N-methylhistamine, while incubation with ERGO or an HNMT inhibitor metoprine significantly suppressed the radioactivity, suggesting that ERGO inhibits murine brain HNMT. Lineweaver-Burk analysis using human recombinant HNMT showed that the inhibition by ERGO was competitive with histamine. Quantification of N-methylhistamine by LC-MS/MS showed that human recombinant HNMT produced N-methylhistamine in a time-dependent manner, whereas ERGO and metoprine significantly suppressed the production. We then examined the activation of microglia, immune cells in the brain, because histamine is an important molecule in the immune system. Immunochemical analysis showed that HNMT was expressed in primary cultured microglia (PCM). Exposure of PCM to ERGO or metoprine significantly increased mRNA expression of CD206, a marker for anti-inflammatory M2 microglia. Thus, the HNMT inhibition by ERGO may be associated with microglial polarization in the brain.