WASHINGTON—At Donald Trump’s first meeting with Gary Cohn in late November, he appeared so impressed with the then-president of Goldman Sachs Group Inc. that he joked about offering him the post of Treasury secretary, said a person who recalled the moment. Sitting nearby was the odds-on favorite for the job, Steven Mnuchin, who got the nod.

Mr. Mnuchin’s confirmation has since been delayed. In the meantime, Mr. Cohn, in office as director of the National Economic Council since the start of the Trump administration, has emerged...