Carl DeMaio is one of three openly gay Republicans running for Congress this year, and he would be at least the third to serve in the House if he wins. But Mr. DeMaio on Thursday will take a step that none of them has, airing a campaign ad that features a shot of him with his same-sex partner.

The clips are brief: A shot of Mr. DeMaio holding hands with his partner, Johnathan Hale, as they march in a gay pride parade in 2012, followed by a clip of the San Diego candidate waving a rainbow flag that symbolizes the gay-rights...