"And I know that we have a respectful disagreement on that issue," the likely Republican presidential nominee said in an interview to air Thursday on "The Ellen DeGeneres show."
McCain, who also opposes an amendment to the Constitution to ban same-sex unions, said people should be encouraged to enter into legal agreements, particularly for insurance and other areas where decisions need to be made.
DeGeneres needled McCain on the issue, arguing that she and the senator from Arizona aren't different.
Last week, after the California Supreme Court cleared the way for gay marriage in that state, DeGeneres announced on her program her engagement to longtime girlfriend Portia de Rossi.
"We are all the same people, all of us. You're no different than I am. Our love is the same," she said. "When someone says, 'You can have a contract, and you'll still have insurance, and you'll get all that,' it sounds to me like saying, 'Well, you can sit there, you just can't sit there.'
"It feels like we are not, you know, we aren't owed the same things and the same wording," DeGeneres said.
McCain said he's heard her "articulate that position in a very eloquent fashion. We just have a disagreement. And I, along with many, many others, wish you every happiness."
DeGeneres steered the conversation back toward the humor she's known for.
"So, you'll walk me down the aisle? Is that what you're saying?" she asked.
"Touche," McCain said.