Ted Olson and David Boies — who teamed up for an epic battle challenging California’s ban on same-sex marriage — were movie stars for the night in New York Wednesday.

The bipartisan buds star in HBO’s doc “The Case Against 8.”

“We were so lucky — the world is lucky — to be able to see the evolution of this real-life case,” Olson told us of directors Ben Cotner and Ryan White filming the case’s five-year journey to the US Supreme Court. “They didn’t know . . . the case could have fizzled in six months.”

Asked whom he’d want to play him in any film remake, Olson cracked, “It would have to be someone really old,” adding Martin Sheen portrayed him in “8” — a play based on court transcripts of the case — and “George Clooney played David . . . he never lets me forget that.”

HBO’s Sheila Nevins introduced the film: “I want to thank myself because when you introduce a film, there’s no one to thank you.” On the scene: Richard Plepler, Larry Kramer, Mamie Gummer, Human Rights Campaign president Chad Griffin, Danny Strong and Submarine’s Josh Braun.