Ali's counsel told Metropolitan Magistrate Akash Jain that the matter had been resolved between them.
He said that Ali had already moved an application for withdrawing the criminal defamation complaint filed against Naqvi.
"Keeping in view the settlement arrived at between the parties....The present complaint is withdrawn as settled," the magistrate said.
The court then acquitted Naqvi.
Naqvi was granted bail by the court July 9 after he appeared before it in pursuance to the summons issued against him.
Ali alleged that Naqvi tarnished his image by linking his name with Yasin Bhatkal in March.
He said in his complaint that Naqvi's tweet linking his name with the suspect Indian Mujaheedin militant was widely circulated in the print and social media and it was not disowned by Naqvi as was apparent from the footage of his statement given to news channels.