For many years, Denis Kruglenko treated life as if it were a delicately calibrated performance. A gay man living in Belgorod, Russia, he knew that even appearing to be homosexual could be perilous. He did what he could to conceal his sexual orientation but it never seemed to be enough. Once, he was beaten up for wearing a pair of pink socks.

In 2014, not long after President Vladimir V. Putin signed sweeping anti-gay measures into law, Mr. Kruglenko fled to New York and applied for asylum. He arrived with little English or money, and found a home in the Sheepshead Bay section of Brooklyn.

The area, which is filled with Russian-speaking immigrants, offered the comforts of familiar foods, his Slavic language and landlords who accept cash payments. But he quickly found that southern Brooklyn resembled Belgorod in another way: His new neighborhood abounded with the same virulent homophobia he had hoped to escape.

“It was almost like I’d never left Russia,” Mr. Kruglenko, 25, said. “Being gay around here is a constant danger.”