Hanks' great-great-great-great grandfather fought in a skirmish at Chesapeake Bay.
"So, Rogers and Hanks not only share the same ancestor they also descend from two brothers who fought for America's independence," Ancestry.com said in a statement to Today.
Access Hollywood surprised the actor with the news on the red carpet. Hanks' wife Rita Wilson responded, "You're pulling our leg."
"A Beautiful Day in the Neighborhood" will be released nationwide on Friday.