The right for same sex couples to get married could be extended to Northern Ireland if devolution is not restored by October.
It comes after MPs backed an amendment which would necessitate the government to act.
The amendment came from Co Armagh-born Labour MP Conor McGinn.
It was backed by 383 votes to 83 on Tuesday afternoon.
The MP for St Helen’s North welcomed the vote.
He said: “This is a fantastic victory for the Love Equality campaign and everyone who has campaigned over many years for equal marriage in Northern Ireland.
“Having been let down so many times before, LGBT people in Northern Ireland can now look forward to enjoying the same rights as everyone else in the rest of the UK and the island of Ireland.”
Mr McGinn, originally from Camlough, added: “I hope to see the Northern Ireland Executive restored and working by 21st October so that they can take the decision to introduce equal marriage.”
The DUP has said the issue would be unhelpful given fresh talks, but Mr McGinn said it would act as an incentive to get the Executive up and running again.
The vote to legalise abortion – again unless devolution is restored by October 21 – was passed by 332 votes to 99.
It came after Walthamstow MP Stella Creasy proposal to the House.
She described it afterwards as “great day for women and their human rights”.
And the Labour MP tweeted after the historic vote: “Thank you to everyone who today stood up for equality in Northern Ireland – whether for same sex marriage or abortion, today we have said everyone in the UK deserves to be treated as an equal. There’s a road to go yet but today a big step forward.”
Abortion is still illegal in Northern Ireland under the 1861 Offences Against the Person Act.
Any future sitting Northern Ireland Assembly, however, could overturn or change the law.
Become a member
Support local, independent businesses by becoming an independent member.Become a member