The "Sully" actor shook their hands, kissed the bride before posing for pictures with them. The encounter was captured on video and photos, including on Hanks' Instagram account.
"Ryan you're a lucky man," Hanks told them. "Elizabeth you're a lucky woman."
While the Academy Award winner respectfully declined an invite to the wedding, he offered to marry them if their minister bailed.
"I am an ordained minister, if the guy cancels just let me know," Hanks joked.
He later posted the selfie of the couple and him and wished them many blessings.
Photographer Meg Miller also documented the surprise meeting on her Instagram page Meg Miller Photography.
"Yesterday's wedding was so beautiful! Elisabeth and Ryan you planned one amazing celebration," Miller wrote. "The icing on the cake was @tomhanks stopping in Central Park to wish them congratulations."