Michael Cohen initially balked at the idea of buying the silence of a former adult-film star who says she had sex with Donald Trump, but he did an about-face after a video of Mr. Trump talking about groping women became public in October 2016.

A day after the recording surfaced of outtakes of Mr. Trump speaking to a host of NBC’s “Access Hollywood,” Mr. Cohen, then Mr. Trump’s senior counsel, told a representative for the performer that he was open to a deal, according to a person familiar with the conversation.

Within days, Stormy Daniels, whose given name is Stephanie Clifford, signed a nondisclosure agreement that provided her $130,000 for her silence. Mr. Cohen had resisted paying Ms. Clifford when it was floated in September 2016, the person said.

Federal prosecutors in New York view the “Access Hollywood” tape as a trigger that spurred Mr. Cohen to bury potentially damaging information about his boss, as they investigate whether the payment amounted to an illegal, in-kind contribution or an expenditure that should have been disclosed by the campaign, people familiar with the matter said.

A spokesman for the Manhattan U.S. Attorney’s office declined to comment.