Mexico City's legislature approved gay marriage on December 21, in the first such law passed anywhere in Latin America.
But the attorney general's office said in its appeal to the Supreme Court late Wednesday that the move was "anti-constitutional," as was adoption by homosexual couples, which was also approved by the city's leftist authorities.
Mexico City Mayor Marcelo Ebrard on Thursday called the appeal a "grave mistake."
It was not the job of the federal attorney general, Arturo Chavez, to decide the capital's laws, Ebrard said.
The initiator of the law, leftist deputy David Razu, said the move went against rights and freedoms, with no legal basis.
Powerful religious groups and conservatives, including from President Felipe Calderon's National Action Party, have loudly opposed gay marriages.
The Mexican capital authorized civil unions for homosexuals in November 2006 and decriminalized abortion in April 2007, contrasting with mostly conservative policies across the largely Catholic nation.