Writer and director Rebecca Miller is married to the famous actor Daniel Day-Lewis. Might this be why the self-centered male character in her recent film “Maggie’s Plan” is so insightfully written? Greta Gerwig and Julianne Moore manage to work with his egocentric shortcomings, and even manipulate them to their advantage, in this witty take on a love triangle.

Gerwig’s character, the titular Maggie, states her goals from the first moment of the film: she wants to have a baby, and she feels that she’s honest enough about her personality to recognize that she doesn’t want a romantic partner for this endeavor. She has chosen a sperm donor from among her acquaintances, a handsome and charming guy from college who gallantly offers to accomplish her goal the old fashioned way, but is rebuffed.

Maggie’s resolve to go it alone falters when she meets Ethan Hawke at The New School where they’re both adjunct instructors. He asks her to read his novel and finds ample opportunities to whine about his famously overbearing wife (Julianne Moore), a more successful tenured academic at Columbia. To quote Moore’s character from another film, “You can imagine where it goes from here.”

But where many romances would end — with new partners shacking up and having the baby they long for — “Maggie’s Plan” is just getting started. After a few years as Hawke’s friendly, helpful female savior, Maggie begins to wonder if her instincts to be a single mother were, in fact, correct. She forms a just-so-crazy-it-might-work plan to return her stolen husband back to his formidable first wife.

There is a growing body of cinema based on Gerwig living in New York City and wearing quirky outfits, but I’m not sure this scenario is robust or interesting enough to deserve its own genre. Most of these films, such as “Mistress America” and “Frances Ha,” ask too much of the viewer’s assumed love of just watching Gerwig exist, like some millennial Annie Hall, without even bothering to add a plot.

Fortunately “Maggie’s Plan” gives us Julianne Moore as a counterpoint and begs the question, is Gerwig’s character Maggie really that lovable and wonderful after all? But even if the film pretends its characters might not think so, the implication is still that the strength of the whole movie experience very much lies in sympathy with Greta Gerwig.

When the whole film isn’t on her shoulders, however, it’s a much more interesting thing. Rebecca Miller did some thought-provoking work here on the subject of marriage and, when it doesn’t focus too much on Maggie herself, “Maggie’s Plan” is a quick but powerful look into relationships between well-written, well-executed characters.

“Maggie’s Plan” is currently available to rent.