Gay marriage is currently allowed in only seven countries and some parts of the United States.
Leftist Mexico City Mayor Marcelo Ebrard is widely expected to sign the decision into law.
The bill calls for changing the definition of marriage in the city's civic code. Marriage is currently defined as the union of a man and a woman. The new definition will be "the free uniting of two people."