A former tax collector in Seminole County, Fla., is in talks with federal prosecutors to plead guilty in an investigation that involves Rep. Matt Gaetz (R., Fla.).

A lawyer for Joel Greenberg agreed in a court hearing Wednesday to a May 15 deadline to reach a plea agreement for his client, who faces charges including sex trafficking and identity theft. The plea discussions, which could signal Mr. Greenberg’s intent to cooperate with prosecutors, emerged at a court hearing Thursday in Orlando, Fla.

“I’m sure Matt Gaetz isn’t feeling very comfortable today,” Mr. Greenberg’s attorney, Fritz Scheller, told reporters outside court Thursday. He later said the terms of any agreement would become clearer in the coming weeks.

Mr. Greenberg, who was active in Florida GOP activities before his indictment last summer, could provide information about Mr. Gaetz, who is under investigation for potential violation of sex-trafficking laws.

Investigators believe Mr. Greenberg met women online through so-called sugar-daddy websites that connect people for dates in exchange for expensive gifts or travel, people familiar with the matter say. Mr. Greenberg was initially charged last year with stalking and identity theft, but federal prosecutors in Florida have since added 31 other counts, including sex-trafficking, bribery of a public official, wire fraud and money laundering. He is expected to face trial in June unless a plea deal is struck before then.