The sins of the high-school cafeteria come home to roost in “The Gift,” a coolly unsettling thriller that begins as an unironic homage to late-’80s/early-’90s yuppies-in-peril dramas like “Fatal Attraction” and “The Hand That Rocks the Cradle,” before taking a turn toward the moral and existential minefield of Michael Haneke’s “Cache.” A modest but accomplished directing debut for actor and screenwriter Joel Edgerton (who also gives himself a plum role here), “The Gift” is a more psychological, slow-burn genre exercise than the psycho-stalker shocker it’s being sold as by DIY horror specialists Blumhouse and Robert Simonds’ newly launched STX Entertainment. But some supremely effective chills and good word of mouth could spell sleeper success for this Aug. 7 opener.

To an extent, “The Gift” functions as a riff on what might be Edgerton’s pet theme — that of an ordinary man undone by a little white lie that grows into a mushroom cloud of deceit. In Edgerton’s script for the absorbing 2013 Aussie police drama “Felony,” that ordinary man was a basically good cop who made an ill-judged decision to conceal his involvement in a drunken hit-and-run. In “The Gift,” our apparent Everyman hero is Simon (Jason Bateman), a sales exec at a computer security firm who has just moved back to his hometown of Los Angeles with his interior-designer wife, Robyn (Rebecca Hall). They luck into a beauty of a mid-century modern in the Hollywood Hills; he seems primed for a promotion at work. All that’s (conspicuously) missing is the pitter-patter of little feet, though not (as we soon learn) for lack of trying.

Instead, they acquire a different kind of houseguest in the form of Gordon (Edgerton), an unwelcome blast from Simon’s past who bumps into the happy couple (seemingly) by chance and, little by little, inserts himself ever deeper into their lives. At first, Gordon just wants to help, rather like the title character in French director Dominik Moll’s darkly funny 2000 thriller, “With a Friend Like Harry” (an American remake of which has lingered in development hell for the past two decades). Undeniably odd-looking (Edgerton plays the part with pasty, reddish-brown hair, an unflattering goatee and ’80s-style hoop earring in his left ear) and socially maladroit — back in high school, they called him “Gordo the weirdo” — Gordon proffers a series of increasingly extravagant housewarming gifts, effectively invites himself over for dinner and otherwise keeps popping up at the darnedest of times. And that’s before things really get too close for comfort. Rest assured: No bunnies are boiled to a crisp, but things do not end well at all for the denizens of a patio koi pond.

Some people change dramatically after high school, Simon reasons (clearly referring to himself), while others remain the same. But as “The Gift” plays out, it becomes increasingly clear that both Simon and Gordon are still very much the same people they were 20 years before — one an unapologetic bully, the other his unwitting victim seeking payback for a shameful episode from their shared past. That basic setup gives Edgerton license to play with some venerable genre trappings — a mysteriously open faucet, a missing family pet, a shadowy presence encroaching on a foggy shower door — which, for all their familiarity, are deployed with a solid understanding of how to make an audience shift nervously in their seats.

Where “The Gift” toys with our expectations is in its refusal to align itself with any one character or to manufacture obvious heroes and villains. In a typical movie of this sort, Gordo’s efforts to make Simon’s life a living hell would eventually reach the point where the latter’s age-old trespasses — no matter how devastating — would pale in comparison with the former’s vengeful tactics. But Edgerton instead keeps our sympathies tilting to and fro on a knife’s edge, forcing us to constantly reassess which of these two men is the more lethal sociopath.

If “The Gift” isn’t ultimately as intricate or surprising a movie as “Felony” (which was directed by Matthew Saville), it remains the work of a sure-handed craftsman who knows how to keep a story moving and when to tighten the screws. Even at its most routine, the movie offers the pleasure of Edgerton’s own superbly creepy performance, which could easily have devolved into ghoulish revenge-of-the-nerd caricature, but instead turns Gordo into a simultaneously pitiable and unsettling figure — a dejected adolescent frozen in time. Bateman, who played some of these same themes for comic effect in his own 2013 directorial debut, “Bad Words,” seems completely at ease as a compassionless alpha who views the world in clearly demarcated terms of winners and losers. And Hall casts a sympathetic presence as the woman trying to sort out which, if either, of these men she wants in her life.

“A Single Man” d.p. Eduard Grau’s moody, low-key cinematography and editor Luke Doolan’s crisp cutting front a generally strong tech package.