The measure, which will provide gay couples with numerous social benefits similar to those of married couples, was approved with 20 votes in favor and 13 votes against, said Rep. Julieta Lopez, of the centrist Institutional Revolutionary Party, or PRI. Lopez helped the draft the bill.
Coahuila Gov. Humberto Moreira, who is also in the PRI, is expected to sign the bill into law.
In November, the Mexico City assembly passed a similar measure for the first time in the nation's history.
That law has been sharply criticized by the Roman Catholic Church and the conservative National Action Party of President Felipe Calderon, the AP reports.
While homosexuality is still taboo in many rural parts of Latin America, the region's urban areas are becoming more socially liberal. Mexico City and Coahuila join the Argentine capital of Buenos Aires and the southern Brazilian state of Rio Grande do Sul in legalizing same-sex civil unions.
At the national level, lawmakers in Costa Rica and Colombia have debated, but not passed, similar measures.