WASHINGTON—Treasury Secretary Steven Mnuchin indicated that the U.S. government would take stakes in airlines in exchange for billions of dollars in direct grants to the companies, according to people familiar with the matter, as part of a $2 trillion economic rescue package.

He detailed his plans during last-minute negotiations when the aid to airlines emerged as a major legislative sticking point. Republicans had rejected providing cash grants to airlines, and an earlier version of the legislation would have provided $50...