At his only news conference as president-elect, Donald Trump told a CNN correspondent, “I’m not going to give you a question. You’re fake news.”

Mayor Bill de Blasio at a contentious October news conference told a New York Post reporter, “You can keep calling all you want. I’m calling on real media outlets.”

The parallels in attitude toward the news media were familiar to prominent New York City political consultants who have worked with both men or closely observed their careers in the city over the years.

Trump and de Blasio are on opposite ends of the political spectrum. But both men interact with the news media — and handle calls for more disclosure of their finances, fundraising or professional relationships — in remarkably similar ways, the experts said.

“The mayor will stand at a podium and lecture the members of the press on how to do their job,” said Bill Cunningham, who was director of communications to former Mayor Michael Bloomberg and also served on the staffs of the late governors Hugh Carey and Mario Cuomo.

“There’s a difference in tone and degree, but basically, that’s what the president does on Twitter,” Cunningham said.

The GOP president and Democratic mayor have positioned themselves as political opposites.

After Trump’s election, de Blasio in a speech declared that Trump’s hometown celebrates a spirit of inclusion, and that the real estate magnate had not. The mayor also attended the Women’s March against Trump in Manhattan on Jan. 21 and is bracing for fights with the White House over federal policies affecting immigrants.

Trump has tweeted that de Blasio is “the worst Mayor in the U.S., & probably the worst Mayor in the history of #NYC.”

De Blasio earlier this month said his refusal to take questions from certain news outlets was “apples and oranges” to Trump’s.

De Blasio press secretary Eric Phillips also has taken issue with comparisons between de Blasio and Trump, telling reporters on Twitter, “You can keep calling people Trump and that doesn’t make them Trump” and “When a reporter’s logic is questioned, call the inquisitor Trump!”

George Arzt, who was press secretary to the late Mayor Ed Koch, said the president and mayor have rockier relationships with reporters than their predecessors.

But Arzt, who as a TV news producer booked Trump for appearances, and as a political operative worked with de Blasio on political campaigns, said de Blasio and Trump are fundamentally different.

Arzt said de Blasio is a “true believer and progressive,” and more of an ideologue than Trump, who will “do what is necessary” politically.

Arzt and others say de Blasio and Trump each struggle with transparency issues. For instance, the mayor has long sought to protect his correspondence with at least five advisers from public disclosure laws.

The “agents of the city,” as de Blasio calls them, include private consultants whose clients have business before the city. But de Blasio has argued the conversations should be privileged in a manner similar to internal city communications.

Common Cause New York was among watchdogs who criticized de Blasio for encouraging a “shadow government.”

De Blasio aides said last month they would make future emails between the mayor and the advisers available upon request. However, the city still is in a legal battle with the Post and NY1 over the release of past “agents” communications.

Some see a comparison with Trump’s refusal to release his tax returns, potential conflicts of interest between Trump’s businesses and his presidency and counselor Kellyanne Conway’s defense of White House characterizations of the size of the inauguration crowd on Jan. 20 as “alternative facts.”

Conway tweeted last week that the tax returns could be released after an audit is complete.

“Agents of change and alternative facts is the same language,” said veteran Democratic consultant Hank Sheinkopf, who has worked on the campaigns of Bloomberg, Bill Clinton and Eliot Spitzer. “They all come from the same dictionary of keep-the-press-from-getting-the-facts.”