Riffing off the popularity of the Tin Pan Alley hit “The Sheik of Araby,” Fats Waller and Porter Grainger celebrated a very different kind of exotic locale in their 1920s song “In Harlem’s Araby.” With lyrics by Jo Trent, the song tells of the Manhattan neighborhood where it was said that strait-laced propriety didn’t apply and rules could be flouted.

The song ended up best known as a jazz instrumental, but the seldom-heard lyrics hinted at the people you’d encounter in Harlem: “Oh, they’ve got women just like men, ’cause they act-a just like brothers.” The theme of gender fluidity was made even more explicit in a playful verse that Grainger sang on a 1924 recording he made with Waller:

In Harlem’s Araby

You can’t tell “B” from “G.”

There’s nothing in the Orient

Like Harlem’s Araby.

That verse does not appear in the published sheet music. But the words leapt off the stage during an exuberant recent performance that opened a New York Festival of Song program at Merkin Concert Hall, “Tain’t Nobody’s Business If I Do: Songs of Gay Harlem.”

Conceived by Steven Blier, the festival’s artistic director, working with Elliott Hurwitt, a historian of early blues and jazz, the program offered music from the Harlem underground, including works by Billy Strayhorn and Grainger, as well as songs popularized by Bessie Smith, Alberta Hunter, Ethel Waters, Gladys Bentley and Ma Rainey — all of whom had, to different degrees, same-sex inclinations and involvements, even if some were married during portions of their lives. Some of the songs were true obscurities, based on scraps of handwritten melodies and lyric sheets excavated by Mr. Hurwitt from storage rooms at the Library of Congress.

The concert attempted to recreate the ambience of a Harlem club. The soprano Bryonha Marie, the mezzo-soprano Lucia Bradford, the tenor Joshua Blue and the baritone Justin Austin, all impressive, were backed, nightclub style, by Mr. Blier and Joseph Li at two pianos, and by a small jazz combo.