Rebecca Miller’s “Maggie’s Plan” is a neatly wrapped gift for every Woody Allen fan who misses the days of “Annie Hall,” “Manhattan” and “Hannah and Her Sisters.”

It’s a fine brew, equal parts cynical and whimsical, dark and sunny. It’s fairly slight but nearly great.

I love movies like this. Movies where we eavesdrop on smart, self-involved, deeply flawed and consistently interesting people as they fall in love, betray one another, lament situations entirely of their own making and pretty much remind us of people WE know — including ourselves.

Writer-director Miller (“The Private Lives of Pippa Lee,” “The Ballad of Jack and Rose”) usually traffics in weightier dramatic material, but she shows a deft touch for sly, borderline screwball comedy here.

Greta Gerwig has a specific range of screen presence — there’s a little bit of Diane Keaton, a little bit of Judy Holliday and her own singular style — which be charming as all get-out in some films (“Frances Ha,” “Greenberg”) and irritating in others (“Mistress America”). She gives one of her most winning performances here, striking just the right notes in playing a young woman with good intentions but some really bad notions of how to carry out those intentions.

Gerwig’s Maggie is single, approaching 30 and yearning to be a mother.

The guy she chooses to be the biological father is literally named Guy (Travis Fimmel), and he’s one of the strangest, funniest and most likable characters in any film this year. Guy is a big, goofy, socially awkward but effortlessly charming pickle vendor — yes, pickle vendor — who is more than happy to comply when Maggie asks him for some sperm.

But before Maggie’s plan can kick into gear, there’s a huge complication, i.e., Ethan Hawke’s John, a “ficto-critical anthropologist” and writer who is going through a personal and professional mid-life crisis.

John’s wife Georgette (Julianne Moore, hilarious) is a towering intellect who speaks in a vaguely Danish accent that sounds like she’s imitating a villain in a Pixar movie. Georgette neglects John in favor of her children and her career — so when Maggie takes spectacular interest in John’s working manuscript and finds his clever insights to be, well, clever, it’s only a matter of time before these two tumble into bed and maybe fall in love.

Bill Hader and Maya Rudolph are wonderful as the Maggie’s best friends, who of course exist mainly to comment on Maggie’s life, be there for Maggie when she falls apart, tell Maggie to get her life together — and oh yes, just occasionally focus on their own problems.

We also get national treasure Wallace Shawn as Kliegler, because movies like this need to have actors such as Wallace Shawn playing characters with names such as Kliegler.

Writer-director Miller is a New Yorker through and through, and throughout the film she finds fresh angles on the city. For once we see parks, campuses, side streets and skyline shots we haven’t seen in a hundred other New York-set films.

The casting is perfect. Ethan Hawke is virtually peerless when it comes to playing a certain kind of Peter Pan, the scruffy, good-looking guy in the Army jacket who is great at seducing women but not so great at staying with them. The kind of dad who is worshipped by the younger child while the older one is starting to catch on to dad’s bull—-.

Julianne Moore’s Georgette could have been a caricature, were it not for a screenplay that includes some surprising reveals about Georgette, and a big, funny performance.

And I told ya I loved the Pickle Guy. The Pickle Guy should get his own movie.

★★★1⁄2

Sony Pictures Classics presents a film written and directed by Rebecca Miller, based on a story by Karen Rinaldi. Running time: 98 minutes. Rated R (for language and brief sexuality). Opens Friday at local theaters.