WASHINGTON — Phil Berg was nervous as he prepared to tell Neil Gorsuch he was gay.

AIDS was still in the headlines at the time, the early 1990s, and same-sex marriage was a far-fetched notion. Some of Mr. Berg’s other friends had not reacted well to his news. So he moved with caution, slipping the word “boyfriend” casually into conversation with Mr. Gorsuch, his dear friend and Harvard Law School classmate.

“He didn’t skip a beat,” Mr. Berg, now a corporate lawyer in Manhattan said, recalling how that conversation led to a “special bond” between the two men. “It was a huge deal for me, and it made a lasting impression.”

Now President Trump has named Judge Gorsuch, 49, of the Federal Appeals Court in Denver, his nominee to the Supreme Court at a time when the clash between gay rights and religious freedom is one of the most contentious questions on the court’s agenda.

Democrats and their progressive allies are marching in lock step to oppose Judge Gorsuch, whose record they find deeply troubling, and gay pundits are painting him as a homophobe. But interviews with his friends — both gay and straight — and legal experts across the political spectrum suggest that on gay issues, at least, he is not so easy to pigeonhole.