The City Council voted Tuesday to legalize gay marriage, giving supporters a victory after a string of recent defeats.