Despite being vocally anti-Trump and pro-marriage equality, Sullivan is considered to be a conservative voice, and he claimed the US media was becoming increasingly hostile to others like him.
In his final piece, Sullivan stressed he had nothing against his colleagues and praised his "wonderful editors and fact-checkers", explaining he was "deeply grateful for their extraordinary talent, skill, and compassion" and that "there's no question of anyone mistreating me or vice versa".
But he said the reasons for his departure were "relatively simple" – a "critical mass of the staff and management at New York Magazine and (parent company) Vox Media no longer want to associate with me".
"They seem to believe, and this is increasingly the orthodoxy in mainstream media, that any writer not actively committed to critical theory in questions of race, gender, sexual orientation, and gender identity is actively, physically harming co-workers merely by existing in the same virtual space," he wrote.
"In academia, a tiny fraction of professors and administrators have not yet bent the knee to the woke programme — and those few left are being purged," he continued, adding that there were even fewer "conservatives" in the mainstream media.
He said he was now going to restart his personal blog, The Dish, which would offer an alternative voice for readers.
"If the mainstream media will not host a diversity of opinion, or puts the 'moral clarity' of some self-appointed saints before the goal of objectivity in reporting, if it treats writers as mere avatars for their race and gender or gender identity, rather than as unique individuals whose identity is largely irrelevant, then the non-mainstream needs to pick up the slack," he said.
New York Magazine is yet to respond to Sullivan's claims, but his resignation was acknowledged in a staff memo by editor in chief David Haskell, who said the decision for Sullivan to leave was "mutual".
"Andrew and I agreed that his editorial project and the magazine's, though overlapping in many ways, were no longer the right match for each other," Haskell said, according to CNN.
Sullivan's resignation echoes that of fellow conservative writer Bari Weiss from the New York Times, who stepped down from the organisation last week with a scathing public resignation letter in which she claimed there was a culture of bullying and self-censorship at the publication.
She claimed she had been attacked for her views by co-workers and slammed the Times for catering to the outraged masses on Twitter.
She described an "illiberal environment" in the workplace and said she was "the subject of constant bullying by colleagues who disagree with my views" and a victim of "unlawful discrimination", having been "openly demeaned" on internal message channels.
Times spokeswoman Eileen Murphy said the publication was "committed to fostering an environment of honest, searching and empathetic dialogue between colleagues, one where mutual respect is required of all".
Kathleen Kingsbury, the acting editorial page editor, said, "We appreciate the many contributions that Bari made to Times Opinion. I'm personally committed to ensuring that the Times continues to publish voices, experiences and viewpoints from across the political spectrum in the Opinion report."