TV

How Maggie Gyllenhaal prepped for her sleazy role as a prostitute

Maggie Gyllenhaal stars as a prostitute in “The Deuce,” premiering Sept. 10 on HBO.Smallz & Raskind/Contour by Getty Images

When Maggie Gyllenhaal was 7 years old, she rode with her Aunt Frieda and Uncle Maury in a taxi to Times Square. They were going to see a Broadway show and Gyllenhaal remembers them speaking in Yiddish, except for one phrase uttered in English: “ladies of the night.”

“They were speaking with disdain, and I was so curious,” says Gyllenhaal, 39, an Oscar-nominated actress (“Crazy Heart”) and elder sister to actor Jake Gyllenhaal. “‘Ladies of the night’ sounds so amazing when you’re 7. I asked them what that meant, and they shushed me.”

The last thing people will be doing is shushing when they see Maggie’s raw, heartbreaking performance as Candy, an aging lady of the night, in the new HBO series “The Deuce,” which debuts Sept. 10. (The first episode is already available for streaming.)

As Eileen “Candy” Merrell, a prostitute who’s been leading strangers up the yellowed linoleum stairs of the Lionel Hotel on 42nd Street for more years than she’d care to remember, she is our tour guide through what legendary journalist Gail Sheehy, in her coruscating 1972 New York magazine expose of prostitution, called “Hell’s bedroom.”

“The Deuce” comes with a lot of boldface names splashed across the screen. Created by David Simon and George Pelecanos, who gave us “The Wire,” it has a big cast of prickly pimps, lethargic prostitutes, cops on the take, mobster wannabes and A-list lowlifes who drop F-bombs like confetti at a wedding in a journalistic overview of a city that was about to discover, in 1971, how much money could be made from the legalization of pornography.

Maggie’s Candy is the lone figure in this crowded canvas who suggests an inner life and the toll the sex trade takes on the human soul. The actress, who lives in Brooklyn with her actor husband Peter Sarsgaard (“The Killing”) and their two daughters, spoke to experts in the field before taking the plunge.

“I needed to talk to someone who’s done this,” she tells The Post. Series executive producer Nina K. Noble introduced Maggie to Annie Sprinkle, a sex worker in the early 1970s.

“She hooked me up with a bunch of her friends,” Maggie says. “Annie was really the key into that world. The women I spoke with were in their 60s. I was so grateful.”

Maggie Gyllenhaal (right), here with James Franco and Pernell Walker, stars as sex worker Candy in “The Deuce.”Paul Schiraldi Photography

Twenty bucks is the going rate for most of the sex acts seen in “The Deuce,” and the girls turn over most of the night’s take to their greedy pimps. As an independent, Candy takes her money home and turns over a portion of it to her mother, who is caring for her young son in a house that looks like it’s in Marine Park or the Flatlands. This extra character dimension sets Candy apart from her “Deuce” peers — and Maggie from the cast.

“When you see sex workers in relation to their work [in movies], you don’t get to see the rest of their existence,” she says. “And with Candy, you get to see her as a mother, as a sister, lover and a businesswoman.”

While filling in for a friend at a Bronx basement porno shoot, Candy goes through the motions on the mattress but becomes fascinated by the filmmaking process as the crew uses various pieces of equipment to control the light and shape the scene.

“I think she’s an artist,” Maggie says. “She’s a filmmaker. The world that she’s in is the world of selling sex. We have four people on a bed and she thinks, ‘What does that bounce do?’ and ‘That frame that the camera makes and where it chooses to go changes everything.’ Once that [desire] gets woken up in her, there’s no way she can [go] back.”

Candy does not become porn’s Kathryn Bigelow overnight, however. There are some false starts and the persistent need to make money. Her in-and-out clientele run the gamut from a horny teenager to a soldier on leave to one morbidly obese fellow who croaks in the throes of ecstasy.

“Sex scenes are an opportunity to articulate what can’t be said in any other way,” she says. “Then, in this show, there was something new because we were doing transactional sex. It was day player after day player. I did find that difficult after a while. I wouldn’t have done if it wasn’t integral to Candy’s story.”

‘I think the reality is sex workers are brutalized all the time. To dramatize that on TV could shift things.’

In a simulation of sexual climax during the porn-film shoot, Campbell’s cream of potato soup is flung at her. What did that feel like?

“Nasty,” Maggie says. “But what an interesting representation of female exploitation. If I portray that in a safe way and it makes you laugh and feel kind of sexy, I think that’s pretty exciting. Inside that image is a whole conversation about sexuality and politics. About misogyny, about commerce.”

But even this extremely good-natured actress had her limits.

In Episode 5, Candy takes a john into a room at the Lionel Hotel. He doesn’t want sex. He wants all of her money. What he does to get it sends Candy to the emergency room — not for the first time.

“A scene like that is so choreographed, and we’re all so careful that neither me nor the guy who’s hurting me is [actually] getting hurt,” Maggie says. “At one point I did say, ‘That’s enough takes. I actually will hurt myself if we do it too many more times’ … Of course, it’s very upsetting. I think the reality is sex workers are brutalized all the time. To dramatize that on TV could shift things. Is it worth it to do it? Yeah. We’re talking about it in a newspaper.”

Fortunately, Candy’s world was so far from Maggie’s life in Park Slope that when she went home at the end of each workday, it was easy to leave the misery and the sleaze behind.

“I had an accent and wigs and it took place in another time,” she says. “I put on my regular Brooklyn clothes. It’s almost easier to leave it behind when there’s a bigger fiction to play. I felt like I was on fire. I felt great when I was playing Candy.”