Stewart announced he had tied the knot by posting a picture of himself and Ozell in a ball pit on Twitter, with the caption: "Yes, married."
McKellen confirmed his part in the ceremony, by posting a photograph of himself on Facebook, holding a Doctor of Divinity certificate and 'Minister' T-shirt.
McKellen and the 73-year-old, who played Captain Jean-Luc Picard in Star Trek: The Next Generation and its successive films, are good friends, having starred together in several films in the X-Men franchise.
McKellen announced his part in Stewart's nuptials during an appearance on The Jonathan Ross show in March.
"I am going to marry Patrick," he revealed, adding: "Well, no, how else do you put that? I am going to officiate at his wedding."