Mr. Trump had already characterized the mayor as a “moron,” and concluded: “Koch has achieved something quite miraculous. He’s presided over an administration that is both pervasively corrupt and totally incompetent.”

Mr. Koch countered then that Mr. Trump was “greedy, greedy, greedy,” and wrote: “Trump obviously considered himself to be my friend at one time, and because of that, or because he gave or raised $70,000 for one of my mayoral campaigns, he expected something in return. He never got it. And he thought that was disloyal.”

Neither the White House nor the Trump Organization responded to a request for comment on Monday.

Pat Thaler, the mayor’s sister, a former associate dean at New York University who helped organize participants for the Women’s March on Washington in her New Jersey community, said on Monday that Mr. Koch would have opposed the Trump agenda on reproductive freedom, health care, freedom of the press and immigration.

“Clearly, he thought him a self-serving egomaniac,” Ms. Thaler said.

In the papers she found, Mr. Koch elaborated on his antipathy toward Mr. Trump with several examples.

One involved the proposed West Side convention center. The former mayor said he was told that Mr. Trump had an option on one site, and that if the city selected it, Mr. Trump would donate his $500,000 brokerage fee to the city — if the convention center was named for him. He later agreed to donate his fee regardless.

After a committee selected the site, Mr. Koch wrote, he never heard from Mr. Trump again about the fee offer.