The 52-year-old, who played lawyer Miranda Hobbes in the Big Apple-based show, lost in a primary to incumbent Andrew Cuomo, who took about 65% of the vote.
Cuomo – currently on his second term as governor – was always ahead in the polls and outspent Nixon by more than eight to one. Much of the $8.5m (£6.5m) he spent went on adverts.
If the money he spent indicated he took the challenge from Nixon seriously, his rhetoric was less than complimentary, implying that the actress relied on her fame, which he suggested was not quite A-list.
“If it was all about name recognition,” he said earlier this year, “then I’m hoping Brad Pitt and Angelina Jolie and Billy Joel don’t get into the race.”
In addition to the lavish campaign spending, Cuomo secured endorsements from Hillary Clinton, Joe Biden and rapper and singer Nicki Minaj, and put a lot of emphasis on the liberal changes he has brought as governor, such as same-sex marriage, gun control and paid family leave.
And he has been scathing about Donald Trump’s administration, saying: “There is a divisiveness coming out of Washington that I think is cancerous to this nation.”
Conceding defeat, Nixon told her supporters: “The other side spent $25m trying to drown us out. But we wouldn’t back down. We refused to be quiet and we made our voices heard.
“I am not discouraged. I am inspired and I hope you are too.”
And she tweeted: “We started something here in New York, and it doesn’t end today. This is just the beginning. And I know that together, we will win this fight.”
Mr Cuomo tweeted simply “Thank You New York”, and skipped his own election-night party to celebrate with family at the governor’s mansion in Albany.
Because registered Democrats outnumber Republicans by more than two to one in New York, Cuomo is now the automatic front-runner in November’s main contest against Republican Marc Molinaro and independent Stephanie Miner.
Cuomo is a former US housing secretary and son of the late governor Mario Cuomo.