Federal prosecutors in Manhattan are investigating whether Michael Cohen, the longtime personal lawyer for Donald Trump, illegally engaged in secret lobbying, people familiar with the investigation said, as part of the government’s broader probe into Mr. Cohen’s business dealings.

In the course of that investigation, the prosecutors have contacted companies that hired Mr. Cohen as a consultant after Mr. Trump won the 2016 presidential election, including AT&T Inc. and Novartis AG, according to other people familiar with the...