Epigenetic gene-regulation abnormalities have been implicated in various neuropsychiatric disorders including schizophrenia and depression, as well as in the regulation of mood and anxiety. In addition, epigenetic mechanisms are involved in the actions of psychiatric drugs. Current anxiolytic drugs have significant shortcomings, and development of new medications is warranted. Two proteins, G9a (also known as EHMT2 or KMT1C) and GLP (G9a-like protein, also known as EHMT1 or KMT1D), which methylate lysine 9 of histone H3 (H3K9), could be promising anxiolytic targets. Postnatal genetic knock-out of G9a reduces anxiety-related behavior, consistent with the reduction of G9a levels by some medications used to treat anxiety (amitriptyline, imipramine and paroxetine). Conversely, there is increased anxiety-like behavior in mice with GLP haplodeficiency. We sought to determine whether two pharmacological inhibitors of G9a/GLP, UNC0642 and A-366, would have similar effects to genetic G9a/GLP insufficiency. We found that G9a/GLP inhibition with either compound reduced anxiety-like behaviors when administered to adult mice, in conjunction with decreased H3K9 methylation in the brain. In contrast, exposure to these compounds from embryonic day 9.5 (E9.5) until birth increased anxiety-like behaviors and decreased social interaction in adulthood, while H3K9 methylation was at normal levels in the brains of the adult mice. These findings reinforce genetic evidence that G9a/GLP has different effects on anxiety-like behavior at different stages of brain development, and suggest that targeting this histone methyltransferase pathway could be useful for developing new anxiolytic drugs. These data also suggest that antidepressant exposure in utero could have negative effects in adulthood, and further investigation of these effects is warranted.