The yearning separations of seafaring life have generated many a romantic ghost story, and while it largely takes place on terra firma, the Danish “No Rest for the Wicked” provides an honorable addition to that roster. Kaspar Kalle’s assured debut feature, drawn from an 1884 story by German author Karl Heinrich Ulrichs — a very early proponent for gay rights — walks a sometimes murky line between love story and horror. But the more sinister aspects ultimately turn out to be deliberate misdirection in this tale of two men who find each other in the remote Faroe Islands of the mid-19th century. In the end, any uneven qualities in Kaspar Kalle’s handsomely atmospheric sophomore feature dissipate in a melancholy poignancy reminiscent of “Brokeback Mountain” and “All of Us Strangers.”

In 1862, Baldur (Egor Venned) is a taciturn young man living with widowed mother Asla (Sofia Nolsoe). Going out one day to fish alone, he’s engulfed by mysterious clouds, then hears cries for help — though once he accidentally hits his head on a rock, it’s Baldur who’s rescued by Helge (Pilou Asbaek), a 40-ish sailor who’d become lost on an unfamiliar side of the island. They make it back to Asla’s cabin, where she’s charmed by their gregarious guest. Baldur is more circumspect, irked at having temporarily lost his boat in the mishap, and unsettled by Helge’s teasing manner, which could be interpreted as either adversarial or flirtatious. Nonetheless, the visitor fills his head with thoughts of adventure, and the many things Baldur has never seen — neither a tree or a mountain, for starters.