It's fitting that Lady Gaga's "Born This Way" is the one-thousandth single to top Billboard's Hot 100 chart. Both as a song and as a video, it's drenched in history. Gaga's built brilliantly on the innovations of generations of musicians and visual artists before her, some obvious, others not ndearly as evident. The ultra-campy introduction to the video, for instance, is set to a passage lifted from Bernard Herrmann's score for the opening credits of Alfred Hitchcock's movie Vertigo; the slime and hardware of the "birth" sequences suggest some of the imagery from Matthew Barney's Cremaster cycle; the "I was born to survive" line hints at the groove's origins in songs like Patrick Hernandez's Hi-NRG disco classic "Born to Be Alive."

But Gaga's "Born This Way" is, at its core, a very gay-friendly gospel-disco anthem, and its most obvious antecedent is Madonna's 1989 hit "Express Yourself." They're very similar songs in a lot of ways, right down to their central conceit of self-expression and adoration for a man who might be more than a man — a him or a capital H-I-M. The slightly subtler Madonna source for Gaga's song is her other capital H-Y-M-N: "Like a Prayer," in which she went back to the gospel roots of the soul music she'd been building on since the get-go. Even the arrangement of Gaga's "Born This Way" is nearly as much gospel as disco: there's some very churchy organ playing all over its chorus.

What's curious about Gaga's song is that she never quite announces what way she was born. (For that matter, neither did the British rap duo Cookie Crew in their terrific 1989 hip-house track "Born This Way.") That's a smart lyric-writing tactic, since Gaga's song is meant to be an anthem for anyone who wants to claim it. She names a bunch of possibilities for sexuality outright — "No matter gay, straight or bi/Lesbian, transgendered life" — in a line that, like a few others, puts its stress in a strange place ("lesbian" doesn't normally get an accent on its second syllable). But she also drops in a little bit of coded language, perhaps as a nod to the history of queer pop discourse: the oddest line in the song ("you're Lebanese, you're Orient") hints at both "orientation" and the famous Ellen DeGeneres/Rosie O'Donnell "I could be Lebanese myself" conversation.

The first landmark "Born This Way" in pop was a bit more straightforward. In 1975, soul singer Valentino recorded "I Was Born This Way," in which he declared "I'm happy, I'm carefree, and I'm gay/And I was born this way."

(Just in case anybody missed the message, it was released on a one-off label called Gaiee; it was promptly picked up by Motown for distribution, still with a Gaiee logo.)

Homosexuality wasn't quite taboo in a pop marketplace that had already embraced David Bowie and Elton John, but it was usually a little less overt.

Things were changing, though. That same year, another Motown act, the Miracles, recorded "Ain't Nobody Straight in L.A.," in which they declared "Homosexuality is a part of society/I guess that they need some more variety/Freedom of expression is really the thing." (Like Madonna, they were presenting sexuality as a kind of expression of oneself rather than a matter of intrinsic identity—what someone does, rather than what someone is.)

Then, in 1977, the Motown hit machine went back to "I Was Born This Way"; its co-writer Bunny Jones co-produced a funkier remake by Carl Bean, which became something of an underground disco standard in various remixes over the years.

To bring it all back around, Carl Bean, as it happens, had a pretty intense background as a gospel singer, and there are gospel inflections all over his version of "I Was Born This Way." He'd initially sung with Professor Alex Bradford, a legendary (and flamboyantly gay) gospel singer, some of whose songs hinted obliquely at his sexuality as far back as the '50s. (It's worth tracking down Bradford's "What Folks Say About Me.") Bean is now a preacher, and still a gay activist.

Like Gaga's, his God makes no mistakes.