The vote took place nearly five months after Peña Nieto proposed the constitutional amendment.
Tens of thousands of opponents of marriage rights for same-sex couples marched through Mexico City in September. LGBT rights advocates staged a counter-protest at the iconic Angel of Independence Movement in the Mexican capital.
The National Front for the Family, which organized the marches against same-sex marriage, welcomed Wednesday’s vote.
“The deputies’ votes constitutes a historic decision in the country,” it said in a statement.
Gays and lesbians can legally marry in Mexico City and in several states across the country.
The Mexican Supreme Court in 2015 ruled that laws banning same-sex marriage are “discriminatory.”
A 2015 ruling said a law that bans same-sex couples from adopting children in the state of Campeche is unconstitutional. The Mexican Supreme Court in September formally published the ruling that sets a legal precedent for the issue across the country.