Michael Stuhlbarg and Elisabeth Moss in “Shirley.” Thatcher Keats/Neon

The writer Shirley Jackson, best known for the gothic classic “The Haunting of Hill House,” was unfairly pigeonholed as a horror writer; although she excelled at creating an atmosphere of queasy psychological discomfort on the page, her work has recently been appreciated for the allegory and social commentary she was practicing with such a dexterous sleight of hand.

Jackson’s penchant for the creepy and the sharply critical are both palpable in “Shirley,” an intriguing adaptation of Susan Scarf Merrell’s novel of the same name. In this speculative drama, Jackson (Elisabeth Moss) and her husband, Stanley Hyman (Michael Stuhlbarg), enter into a vampiric relationship with a young couple who have arrived at Bennington College, where Hyman is an instructor. What ensues will recall “Who’s Afraid of Virginia Woolf?” at a slightly less hysterical but no less discomfiting pitch, as the two couples befriend, fight and ultimately merge with one another in increasingly destabilizing ways.

Logan Lerman and Odessa Young in “Shirley.” Neon

Moss delivers a ferociously self-contained depiction of a woman in the throes of creative and marital discord: She is so tense, unkempt and emotionally wrung out that she’s barely recognizable. As the film opens, Jackson has just published the short story “The Lottery” in The New Yorker, a triumph that has put her on the literary map. When Rosemary and Fred Nemser (Odessa Young and Logan Lerman) arrive on the Jacksons’ doorstep in the midst of one of the couple’s famous cocktail parties, their hostess can barely wait to crawl back into bed.

As she did in 2018’s “Her Smell,” Moss delivers a ferocious star turn in a film that functions primarily as a showcase for her tough, uncompromising talents. Stuhlbarg is just as convincing as Stanley, a charismatic bohemian who plays Lead Belly (to the slightly scandalized titters of his adoring students) and treats Shirley with uxoriousness that doubles as thinly veiled cruelty and exploitation: He plies her with whiskey and encourages her to write, all the while undermining her with brazen affairs and passive-aggressive put-downs.

The perverse symbiosis between Shirley and Stanley both attracts and repels Rose, who is grappling with her own ambivalence about married life. When Shirley enlists her to help with her next story, the two women traipse down a rabbit hole that feels increasingly dangerous – or, just maybe, liberating. Director Josephine Decker, working from a script by Sarah Gubbins, approaches her subjects obliquely, often filming them as though peering through a keyhole or barely parted curtains. Her visual style, reminiscent of a waking dream, both heightens and mirrors the paranoid style of Jackson, who is prone to visions and moments of unsettling psychic insight.

But is she paranoid, really? Things get stranger in “Shirley,” but they also get clearer, as the central relationship reveals itself as both goad and noose when it comes to Jackson’s creativity and well-being. Doubling is a major motif in a film that, by its conclusion, has merged its characters so effectively that viewers may not be entirely certain whose breakdown they’re witnessing. Maybe it’s their own.

“Shirley” sometimes feels as unfocused as the stymied protagonist at its core, but its point of view remains crystalline throughout: As Shirley tells Rose early in their friendship, best to be born a boy. “The world is too cruel for girls.”