Ben Stiller and Noah Baumbach have worked together before. Naomi Watts and Noah Baumbach have not.

For the actress, trying to crowbar her way between the collaborators of 2010's Greenberg - Stiller starred in a decidedly Baumbachian role, Baumbach wrote and directed - seemed like it might not be that easy.

"Noah's relationship with Ben was already well-established," Watts says. "So it was scary coming into that dynamic. I thought, 'How am I going to hold my own?' These guys are, like, besties and totally in love with each other."

She laughs, adding that her anxiety was for naught. "They couldn't have been more welcoming."

The film on which the trio - plus Adam Driver and Amanda Seyfried - found themselves working is While We're Young, a funny, trenchant riff on generational longing. Opening Friday , Baumbach's movie finds Stiller and Watts as Josh and Cornelia, married documentarians in their 40s, and in a rut. Along comes the canoodling hipster duo played by Driver and Seyfriend. He makes docs, too. She makes ice cream.

First Josh, then Cornelia take to Jamie and Darby - twentysomethings who remind the fortysomethings how free and spontaneous their lives used to be. While Josh and Cornelia are busy working their smartphones and iPods, Jamie and Darby are using typewriters and listening to LPs. Their album collection covers an entire wall in their Brooklyn loft.

"I think that's part of their allure," Watts says of the younger couple they befriend in the film. "We think, 'Oh wow, they are so pure. And we're not. Typewriters and vinyl - they must be authentic!' So we're completely fooled by that. It's a good irony."

Baumbach trades in irony, and the film takes its increasingly chummy quartet to places where the contrast between who these people are and who they want to be becomes painfully apparent. Painful laughs, that is.

"People are just never happy with who they are at the moment, but looking back, we think it was probably not that bad. Was it?" Watts mulls, on the phone from Los Angeles, where she lives with Liev Schreiber while he's filming the Showtime series Ray Donovan.

"When you think about your 20s, when we just wanted to be wise and brilliant, it was probably just a lot of fun, doing exactly what you're supposed to do at that age - being reckless, and a bit ruthless, and selfish."

Making While We're Young, Watts found herself marveling at Baumbach's writing, the pages and pages of dialogue he had her do.

"It wasn't hard to remember because his writing is so well-crafted; it just goes in beautifully. It's not like you have to wrestle over six pages of dialogue. That's a test. That's how you know when you're dealing with brilliant writing - it just goes in, it feels organic."

Perhaps because of the precision in his writing, she says, Baumbach did not encourage improvisation.

"No, he's not interested, I can tell you that right now," she says, laughing again. "Down to the smallest words, he wants it the way it is on the page. But you know what? It's refreshing working with someone who is absolutely sure of themselves. It's much easier to trust someone who's got an absolute vision. Not to say that he's completely rigid about any nuance or anything like that."

One of Watts' favorite scenes in the film, though, has hardly a word in it. It's when Cornelia goes dancing - something she hadn't done in ages.

"Noah just kept the music playing and kept the cameras rolling and I just kept dancing - and I really didn't think it would go on that long, but we were having fun. It was emblematic of where Cornelia was at. She was living this fairly complacent life and needed to wake up, and then suddenly she was thrown into it and became wild like an animal . . . It was almost like a rebirthing for her. She forgot where she was. She didn't care about anyone. And she just attacked it with ferocity."

Watts, 46, says she hopes to work with Baumbach again. Her favorites among his films are The Squid and the Whale (2005) and Margot at the Wedding (2007), which stars her old Aussie acting chum Nicole Kidman. "Growing Up Baumbach," a minifestival of the New York filmmaker's work, is underway at the PFS at the Roxy. While We're Young premiered there Thursday. Frances Ha (2012), starring Greta Gerwig, screens Thursday night; The Squid and the Whale on the 16th; Kicking and Screaming (1995 - his debut) on the 23d. (For info: http://filmadelphia.org)

While We're Young represents a new turn in Watts' career, she hopes. After years of intense dramas (Fair Game, J. Edgar, The Impossible), she's decided to have some fun. In St. Vincent, she plays a Russian stripper who drops in on the curmudgeonly sloth played by Bill Murray for some personal pole dancing. In Birdman, she's the actress wife of the egomaniacal thespian played by Edward Norton.

"I was coming off a sort of long journey of doing heavy drama, and I felt like I was getting set in that. I'd gone off people's radar completely for anything that resembled comedy," she says. "People kept seeing me fixed in this world of drama, and so they probably thought I wasn't interested [in comedy].

"So I had to proactively put the message out that I did indeed want to do comedy. I went on a search. And it just so happened that I had one year, with these three films, and it was really lucky for me. They were small parts - Cornelia being the biggest one - so it was a good way to gently ease into this new territory."

As for being part of the ensemble of Birdman, the best picture winner at this year's Academy Awards, Watts says she'd do anything director Alejandro González Iñárritu invites her to do.

"He came to me very early on," she says of the filmmaker, for whom she starred in the intense-o 2003 drama 21 Grams. "Michael Keaton was in talks with him, but no one was set, and he just said: 'Would you do this for me, as a favor? It's just a couple of weeks.'

"And the way he was talking about it, before I'd read it, he was like, 'It's kind of an experiment, I just think it would be an interesting idea.' Two years later, and we're all standing on the stage at the Oscars!"

Next up for the actress is a return visit to the world of Divergent. In the just-released second installment, Insurgent, Watts is Evelyn, mother of Tobias "Four" Eaton (Theo James). Shooting on the third film, Allegiant: Part 1, could start as early as May. If you've seen Insurgent, or read the Veronica Roth trilogy, you know what Watts gets to do. If you haven't, you may not want to read on. (Clue: She and Kate Winslet have a major faceoff.)

"It's so funny," she says. "When I was being asked to do Insurgent, I was like, 'Well, why are you selling it to me like that was some fantasy of mine?'

"But it's always great to go to work with your contemporaries. Women don't always end up in films together, unfortunately, so that was really a plus for me. Kate had been in the one before, and she is just someone whose work I've long admired."

srea@phillynews.com

215-854-5629

@Steven_Rea