Their differences melted away on the dance floor. When Mr. Florke wrote his number on a napkin, Mr. Maloney put it in his wallet. He kept it there for 20 years.

Mr. Florke, 51, and Mr. Maloney, 47, who was elected in 2012 as New York’s first openly gay congressman, were married last month at a church near their home in Cold Spring, N.Y., as their three children looked on. Representative Nancy Pelosi, the House minority leader, gave a toast. Joan Osborne, the pop singer, crooned a ballad for their first dance.

It was a moment that neither could have predicted from that night at the Roxy, when Mr. Florke, heartbroken from losing a longtime partner, was only seeking a casual fling; when Mr. Maloney, about to start work at a white-shoe law firm, was still wondering, and worrying, about what it would be like to date a man.

Each had arrived in Manhattan via very different paths. The son of an Iowa farmer, Mr. Florke came out when he was young and moved to New York at 18, enrolling in a fashion course. Mr. Maloney was the youngest of six children in a staunch Catholic family and attended elite schools, where he dated women.

“I was so dramatically different from the world that he had come from,” Mr. Florke said. But at the time, it suited him: “He was just coming out of the closet. I thought it was perfect, because he wouldn’t be looking to have a relationship.”