Dutchess County elections official Erik Haight said Saland defeated Neil DiCarlo by 107 votes out of about 9,800 cast in the Hudson Valley's 41st Senate District.
Saland told The Associated Press he knew the primary would be no "walk in the park," but said he never wavered on his decision in June 2011 to support same-sex marriage.
It was Saland's first primary in more than two decades in the Senate.
DiCarlo could challenge Saland again in November as a Conservative Party candidate.
In the 43rd Senate District recount in Saratoga County, Republican Sen. Roy McDonald trails Kathleen Marchione, the Saratoga County clerk. McDonald also supported gay marriage.
As the counting continued Monday, Marchione's lawyer, Michael Cuevas, told the Albany Times Union that a Marchione win was "inevitable." However, McDonald was not yet ready to concede.
A third Republican senator who voted for gay marriage, Mark Grisanti of Buffalo, won his primary in the 60th District.