He should "move forward with humility," McGreevey said on NBC-TV's "Today" show.
McGreevey, a Democrat, said he could relate to the emotions Sanford, a Republican, felt when Sanford announced his extramarital affair and admitted he misled people about his whereabouts for a week.
"I'm filled with a sense of pain and anguish for him and for his family," McGreevey said in the interview. "I think it was a very human moment."
In 2004 McGreevey publicly declared his homosexuality and admitted to having had an extramarital affair with former aide Golan Cipel, who the governor hired in 2002 as an adviser to the state Office of Homeland Security. McGreevey resigned after his public confession.
He said Thursday he did not think Sanford's political career was necessarily over.
"He can be that much more of a better governor because it's admitting his nature, understanding the wrongs," McGreevey said.
He said Sanford needs to rededicate himself to a "sense of service and a sense of godliness" and should embrace his wrongdoings honestly and openly, The (Newark, N.J.) Star-Ledger reported.
"As a Christian, I believe in the power of forgiveness," McGreevey said. "We all sin. We all fail. It's how we grapple with that failure."
McGreevey is pursuing a Master of Divinity degree, a requirement for becoming an Episcopal priest.