This year, D B Pace applied under a state program to undertake a voluntary cleanup of the property. If approved, the company would also gain protection against liabilities related to any pollution there, such as chemical contamination of local groundwater, caused by Titan Atlas and other past owners.

There is, however, a catch: To qualify for the protections, the buyer of a contaminated property must not be affiliated with a former owner, or have had involvement with the site.

The program’s rules exist, lawyers said, to prevent a polluter from evading liability by using another company to stand in its place. “You are basically drawing a line in the sand,” said John P. Boyd, a lawyer in Columbia, S.C., who negotiates such so-called brownfields agreements for companies buying contaminated land.

D B Pace, which took title to the North Charleston property in January after a foreclosure proceeding, stated to South Carolina regulators that it was free of such associations. But according to a lawsuit, both the younger Mr. Trump and a Trump Organization lawyer, who is also a D B Pace executive, managed the Titan Atlas facility for two years before D B Pace applied to the state’s program.

The lawsuit at issue was filed in April by a former tenant at the Titan Atlas factory. In it, a building products company, Saint-Gobain Adfors, charged that it had complained since 2014 to Donald Trump Jr. and the Trump Organization lawyer, Michael Cohen, that rain coming through the building’s rotting roof was damaging materials stored there.