In the New Orleans-filmed “99 Homes,” director and co-writer Ramin Bahrani turns the real estate crash of the late 2000s into a thriller. After all, there’s much drama, even danger, in an eviction.

New Orleans and its suburbs play Florida in “99 Homes.” The Sunshine State led in home foreclosures in 2010. That year, following a decade of recklessly flowing mortgage loans and tripled home prices, U.S. foreclosures reached an all-time high.

Bahrani directed principal cast members Andrew Garfield, Michael Shannon and Laura Dern in “99 Homes,” as well as many non-actors. He credits the locals for the film’s authenticity.

“Real people are in the film,” the New York-based Bahrani said recently. “They kept the professional actors on their game.”

When Garfield knocks on front doors in “99 Homes” for the purpose of evicting residents, he didn’t know who was on the other side of the door.

“Every other one is a real person in their real home,” Bahrani said. “And I never told Andrew what was going to happen. He didn’t know if the person had a gun. He didn’t know if they had a reverse mortgage or if they could speak English.”

The cast of nonprofessional actors also includes most of the movie’s post-eviction cleanup crew and one of its evicting law officers.

The unlikely partnership that develops between Garfield’s Dennis Nash and Michael Shannon’s Rick Carver animates the central conflicts in “99 Homes.” Carver, a seemingly merciless real estate broker, evicts the shell-shocked Nash family from their home near the beginning of the film.

The film’s several evictions happen with heartbreaking swiftness. The Nash family’s eviction, for example, displaces Nash, a young, single parent, his elementary school age son and Nash’s especially emotional mother, played by Laura Dern.

After Carver evicts Nash, the real estate broker notices that his latest evictee has many skills a real estate broker can use. Carver offers Nash work on foreclosed properties.

“Andrew’s character is in this deal-with-the-devil kind of story,” Bahrani said. “He walks a moral tightrope. How far will he go to protect his family? It’s easy to say, ‘I’d never evict someone,’ but then you see how quickly it happens in the film.”

Despite the deal-with-the-devil aspect of the Nash-Carver relationship, the movie’s director doesn’t see Carver as the devil.

“Michael’s character is the devil in the story, but for me, the system is the real villain,” he said. “Rick Carver is a product of that system. Real estate brokers didn’t sign up to evict people. They signed up to put people into homes. But evictions became their job. If they don’t do it, somebody else will.”

From his filmmaker’s perspective, Bahrani wanted his dynamic duo, Shannon and Garfield, in as many “99 Homes” scenes as possible.

“As Michael says to Andrew near the end, ‘You wanted to kill me once, but now you’re making a lot of money with me.’ Andrew is surprised, but he is working with the guy who threw him out of his house. They even understand one another.”