A former prosecutor who once helped lead an investigation of Donald J. Trump will testify before Congress next month, ending for now a legal dispute between Republican lawmakers and Alvin L. Bragg, the Manhattan district attorney, who had sought to block the testimony.

The former prosecutor, Mark F. Pomerantz, is now scheduled to testify under oath to representatives of the House Judiciary Committee in a closed-door deposition on May 12. Mr. Pomerantz worked for the Manhattan district attorney’s office for about a year, but resigned more than a year before Mr. Trump was indicted, and wrote a book that described his frustration with Mr. Bragg’s approach to the investigation.

Representative Jim Jordan, a Republican from Ohio, subpoenaed Mr. Pomerantz this month, shortly after Mr. Bragg unveiled charges against Mr. Trump, accusing him of orchestrating the cover-up of a hush-money payment made to a porn star in 2016.

Mr. Bragg then sued Mr. Jordan, the chairman of the House Judiciary Committee, accusing him of meddling in the affairs of the district attorney’s office after its indictment of Mr. Trump. The lawsuit sought to block the questioning of Mr. Pomerantz.

After a federal judge declined to halt the interview, both Mr. Bragg and Mr. Pomerantz appealed to the U.S. Court of Appeals for the Second Circuit. The appeals court delayed the questioning, which had originally been scheduled for Thursday. During the delay, lawyers for Mr. Bragg and Mr. Jordan negotiated and reached an agreement that was announced on Friday evening.

A spokeswoman for the district attorney’s office said in a statement that the resolution would allow the office’s general counsel, Leslie Dubeck, to be present for the questioning of Mr. Pomerantz. A lawyer for Mr. Pomerantz is also expected to be present, and Mr. Pomerantz may decline to answer questions that he is not authorized to discuss. Congressional Republicans may contest his right to remain silent in future proceedings.

In a statement, a spokesman for Mr. Jordan said the committee looked forward to Mr. Pomerantz’s appearance. A lawyer for Mr. Pomerantz did not immediately respond to a request for comment.

Though the agreement ends Mr. Bragg’s lawsuit, which was filed April 11, the dispute between the district attorney and Mr. Jordan seems far from over. More legal turmoil is likely to follow if congressional Republicans seek to question other prosecutors who participated in the investigation of Mr. Trump.

Hurubie Meko contributed reporting.