In 1979, British author Kit Williams published "Masquerade," a blend of child's fable and quirky illustrations that promised a literal treasure to the reader who could solve its intricate puzzle. A runaway bestseller, this whimsical book tapped European folklore, a fresh twist on old legends.

Helen Oyeyemi's new novel, "Gingerbread," is a masquerade of its own, a loose re-imagining of the Hansel and Gretel fairy tale, each character clothed in an array of disguises. In London, three women — teenage Perdita Lee, her mother Harriet, a teacher, and her sardonic grandmother Margot — plod through lessons and neighborhood meetings, living off gingerbread baked from a recipe they've used since Harriet's childhood in Druhástrana. (As in her previous work, Oyeyemi plants her flag at the intersection of fantasy and realism.) Their unhappiness is hinted at rather than explored.

After a medical scare, Perdita recuperates at home, where one night Harriet narrates her past to her daughter and a gang of cheeky talking dolls, cousins to the puppets in Oyeyemi's scalp-tingling story, "Is Your Blood as Red as This?"

From adventures with her changeling friend, Gretel, to a stint as a Gingerbread Girl to escape to England, where she and Margot get caught in the web of the wealthy Kercheval family, Harriet spins a personal myth tinged with the brutality of capitalism and race, the painful depths of the mother-daughter relationship.

These themes are refracted through Oyeyemi's cubist prism, her melding of imaginary lands with our own: mobile phones, YouTube and Tumblr alongside mail pigeons, sachets of magic powder, and fireflies that speak Korean. There are sly criticisms about the literary industry's obsession with prizes and lists. There's fluid sexuality. There are genre-bending tricks and puns galore. There are possible echoes of Williams' "Masquerade," Ian Mc­Ewan's "Atonement," and even episodes of Dr. Who, the classic science-fiction television series.

Welcome to Oyeyemi World.

"Gingerbread" struggles to find its emotional sweet spot, leaning into self-conscious flourishes and a plot that occasionally feels unmoored, devoid of gravity, an Escher drawing in print. Oyeyemi loves to poke us in the eye. Only in the novel's stirring last act, as Harriet, Margot and Perdita seek out Gretel with the help of a creepy real estate agent, Miss Maszkeradi, does "Gingerbread" come together. The narrator steps forward, mocking us — "Hmmm … still here?"

For all her shape-shifting sentences, Oyeyemi still gives us dashes of lyricism; few writers can milk an ellipsis with such dramatic precision, as in Perdita's piano recital, "a minimalist rendition of the original, as much silence as it was song. The notes had this aural flash to them … it was like glimpsing a swan through reeds."

Harriet never makes it to the gingerbread house of her dreams, although another woman succeeds. With this final hook, "Gingerbread" rises to the level of "Mr. Fox" and "Boy, Snow, Bird," revealing Oyeyemi as a master of literary masquerade, forging a singular art.

Hamilton Cain is the author of "This Boy's Faith: Notes From a Southern Baptist Upbringing," and a member of the National Book Critics Circle. He lives in Brooklyn.

Gingerbread
By: Helen Oyeyemi.
Publisher: Riverhead Books, 258 pages, $27.