He was responding to a comment from the leader of the Catholic Church in Ireland, Archbishop Eamon Martin.
Archbishop Martin had said any Catholic politician who supported abortion would not be "in communion with the church".
The deputy first minister spoke to BBC's Inside Politics on Friday.
"I try and be the best Catholic I can be," Mr McGuinness said.
"The Catholic Church is made up of people who have different opinions on different issues."
Mr McGuinness repeated that Sinn Féin is opposed to abortion on demand but said he had been moved by meeting Sarah Ewart, a woman from Northern Ireland who had to travel to England for an abortion because her baby had no chance of survival.
He said:"I think, in the context of my responsibility as a government minister and other government ministers who have a duty to pass legislation, when we're faced with the case of Sarah Ewart, we have to deal with that in the most compassionate way possible."
Northern Ireland's Department of Justice is consulting on whether abortion should be made legal in cases of "lethal foetal abnormality" and pregnancy as a result of rape.
On Thursday, Archbishop Martin met Justice Minister David Ford to discuss proposals for amendments to two aspects of Northern Ireland's abortion laws.
He said the church remained against any change to the existing laws.
The deputy first minister said he disagreed with people who believed a change in the laws would lead to an "opening up of the floodgates".
He said: "I totally and absolutely contradict those people. I think what we need to do is recognise our responsibilities to support women when they make the choice.
"This is not about women being forced to do anything, they should be able to make their own choice. I absolutely respect the right of people to do that."
Sinn Féin's support for a woman's right to an abortion in certain limited circumstances is not incompatible with Catholicism, Martin McGuinness has said.