Mayor Bill de Blasio’s top lieutenants ordered City Council members not to speak to The Post months ago — even issuing a thinly veiled threat to at least one lawmaker if he failed to toe the line, the pol told The Post.

“You shouldn’t be talking to The Post when they’re criticizing the mayor,” de Blasio aide Jon Paul Lupo warned, according to the council member, well before Lupo’s tantrum-throwing boss dismissed the paper as a “right-wing rag’’ last week, taking heat from both sides of the political aisle.

“We remember who our friends are, and we remember who kicks us when we’re down,’’ Lupo said, according to the Democratic council member he targeted.

The source said mayoral aide Emma Wolfe also issued similar, though “less direct,’’ warnings about talking to The Post.

“Any time a council member is quoted [in The Post] — even when and especially when they’re right — they’re going to get a call from the Mayor’s Office,” the council source said.

The Mayor’s Office denied the claims as “categorically untrue.”

“Never happened,” said de Blasio spokesman Eric Phillips.

The warnings were issued several months before de Blasio’s bush-league comment last week, the source said.

But instead of ripping The Post, the Democratic mayor should be concentrating on fixing what’s not working in his administration — which is plenty, critics said.

“He should spend less time fighting with reporters and more time doing his job, which includes answering questions transparently,” said Councilwoman Elizabeth Crowley (D-Queens). “He does not get to pick and choose what questions he takes.”

Even critics of The Post faulted de Blasio.

“On the one hand, it’s true that the New York Post is a right-wing rag,” quipped Councilman Rory Lancman (D-Queens). “But on the other hand, we don’t get to pick and choose who asks questions of us and who we get to respond to.”

Councilman Ben Kallos (D-Manhattan) contended that reporters and voters should decide what questions are asked — not the mayor.

“Elected officials have to be open to the public, and whether that’s taking calls on a radio show or at a press conference, we work for the people, and they get to decide what questions they want to ask,” he said.

De Blasio’s alleged cold shoulder to certain members of the council who speak their mind is nothing new in New York City politics.

Mayor Rudy Giuliani would often freeze out rivals who criticized him in the papers, said former Councilman Sal Albanese, adding that Giuliani instructed city agencies not to return his calls on more than one occasion.

“You’re being threatened,” he said of the sleazy antics. “They may run a candidate against you. They might cut off access to the administration.”