It is among the success stories of industrial New York: A warehouse that once housed a copper company was transformed into a film studio replete with stages, sound rooms and sets as the city experienced a boom in film and television production.

Eastern Effects, the company that built the studio, started in 1999 with a single employee in an apartment-size office and grew to include a small complex of buildings in the gentrifying area around the Gowanus Canal in Brooklyn. Large segments of “The Americans,” the show on FX about Cold War spies, were shot there.

But this week, the company learned that it would most likely have to leave the warehouse, home to most of its production space, within five years. The parcel, at 270 Nevins Street, was selected by the city and approved by the Environmental Protection Agency to be used in its cleanup of the area, part of an agreement that was made final on Thursday.

In its cleanup of the canal, declared a Superfund site in 2010, the E.P.A. worked with the city to find a location for an eight-million-gallon sewage tank to help curb discharge during heavy rains.