Jessica (Camila Márdila) makes a big splash when she comes to stay in the Brazilian home where her mother, Val (Regina Casé), is a class-conscious housekeeper in “The Second Mother.” (Aline Arruda/Oscilloscope Pictures)

What kind of person uses all the ice cubes, then puts the empty tray back in the freezer? That’s what Val (Regina Casé) asks, of no one in particular, while the presumed culprit, teenage Fabinho (Michel Joelsas), sits eating breakfast. “What a mean person,” she continues, as the boy gives her a knowing smile.

It’s one of many funny, telling moments in “The Second Mother,” set in Sao Paulo, Brazil, and it proves Val’s maternal instinct for passive-aggressive martyrdom. Except Fabinho isn’t technically Val’s son. Yet, as the live-in housekeeper for the boy’s family, she has done more to raise him than his actual mother, the meticulously lipsticked style maven Bárbara (Karine Teles). At the same time, Val remains an outsider, relegated to sleeping in a cramped, stuffy room and forbidden to eat at the family’s dinner table or to swim in their pool.

She hasn’t given too much thought to the injustice of it all, at least until her daughter Jessica (Camila Márdila) arrives. While Val has been raising Bárbara’s son, one of the housekeeper’s friends has been raising Jessica in their far-off home town. Though mother and daughter haven’t seen each other in a decade, Jessica — who is close in age to Fabinho — swoops into town in anticipation of studying in the big city. In short order, she has moved in with Val — and, by extension, Bárbara, Fabinho and the loafing family patriarch, Carlos (Lourenço Mutarelli).

Written and directed by Anna Muylaert, “The Second Mother” feels lovingly handcrafted. All the elements of the story fit impeccably together for a humorous and occasionally wrenching examination of relationships.

Not that all of the perfectly placed pieces make this story or the social mores straightforward. “The Second Mother” is complicated by the fact that Jessica refuses to be subservient to Val’s employers. She sneaks ice cream from the freezer, swims in the pool and asks for what she wants, including to sleep in the airy guest bedroom, rather than on a mattress in her mother’s room. And Carlos, who takes a keen if creepy interest in Jessica, is more than happy to comply.

Meanwhile, Bárbara becomes increasingly annoyed by the young interloper. If Val’s instinct is to scold Jessica for not knowing her place, she nevertheless finds herself caught between loyalty to her surrogate family — and all the unwritten rules that her life with them entails — and devotion to her offspring.

Considering how low-key the action is, the movie manages to create a lot of tension. Stealing ice cream is hardly a major crime, but each seemingly trivial domestic incident adds exponentially to the drama. It’s these little things that matter.

Val has everything to lose, and Casé does a remarkable job of bringing her character to life. She’s so effusive, nuzzling both Jessica and Fabinho, and calling each “my treasure,” but she’s no pushover. She gives Carlos a hard time for not eating the food she cooks and berates Fabinho’s friend for his unkempt hair. “Have some respect” is her refrain, suggesting that Val doesn’t just adhere to constraint, but is willing to impose it, too.

Throughout the film, there’s a recurrent theme of nature vs. the social order. From the noise of nearby construction saws to a conversation about how quickly the jungle would reclaim Sao Paulo if all the people in it were to disappear, these elements create a telling parallel to Val’s situation. She struggles to comply with her employers’ arbitrary rules about pool usage and such. Ultimately, the film suggests, blood is thicker than water.

R. At Landmark’s E Street Cinema. Contains strong language and drug use. In Portuguese with subtitles. 114 minutes.