Mr. Cohen’s mounting courthouse woes — two different civil lawsuits and a separate criminal investigation — have, of course, already devolved into a media circus, as even his own lawyers in New York have noted. Aside from the breach-of-contract suit, Mr. Avenatti has sued Mr. Cohen in another California case, claiming he conspired with Ms. Clifford’s former lawyer, Keith Davidson, to quash the story of her alleged affair with Mr. Trump. And Mr. Cohen is under investigation by federal prosecutors in Manhattan, who are looking into whether he broke the law in any of various business dealings, including the hush-money payment to Ms. Clifford.

Mr. Cohen’s request for a judicial order to silence Mr. Avenatti was extraordinary, not the least because he himself has long had a reputation for employing hardball tactics, especially when it comes to the media. The gag-order motion followed a series of TV appearances that Mr. Avenatti made on Wednesday night predicting that Mr. Cohen would turn on Mr. Trump and cooperate with the New York prosecutors who are leading the criminal inquiry.

Those appearances were themselves prompted by news reports earlier on Wednesday that Mr. Cohen was planning to split with his criminal defense team in part because of a dispute about his legal bills, some of which the Trump family has been paying. The disagreement over money — how much of the bills should be paid and for how long — could serve to further isolate Mr. Cohen from Mr. Trump, a risky move for the president that could intensify the pressure on Mr. Cohen to cooperate.

Mr. Avenatti responded to the gag-order request on Twitter on Thursday night, calling Mr. Cohen’s motion “a complete joke and baseless.” On Friday, Judge Otero refused to issue an immediate emergency ruling on Mr. Cohen’s request, asking for additional papers to be filed in the next two weeks by both sides.

In a federal court hearing last month in Manhattan stemming from the criminal investigation, a lawyer for Mr. Cohen complained about statements by Mr. Avenatti, who had sought to appear formally in New York in order to protect any records related to Ms. Clifford that the authorities may have seized when they raided Mr. Cohen’s office, apartment and hotel room in April.