"The Dying Gaul" is a stylish, nervy neo-noir thriller that, although well received on the festival circuit this year, nearly didn't get released.

It's a good thing it did, because this smart, good-looking movie deserves an audience. For starters, it boasts a cast to die for -- Campbell Scott, Patricia Clarkson, Peter Sarsgaard -- in a minor-key chamber piece about a Hollywood producer named Jeffrey (Scott), his screenwriter wife Elaine (Clarkson) and an aspiring young filmmaker named Robert (Sarsgaard) who comes into their lives and changes them forever.

At first, Sarsgaard's character, still in mourning for a dead lover, is all vulnerability and artistic integrity, with Scott's sharklike producer demanding a crowd-pleasing rewrite before he agrees to take on the newbie's script -- which, as it happens, is called "The Dying Gaul." But soon enough, who's zooming whom -- and who's wooing whom -- becomes deliciously ambiguous, as all sorts of sexual games and power shifts ensue.

The estimable playwright Craig Lucas ("Prelude to a Kiss," "Longtime Companion") has adapted his own play for his debut as a film director, and an auspicious first outing this is. "The Dying Gaul" is a small gem of incisive writing, superb acting and rich, expressive visuals. Most of the action transpires at the sleek, flawlessly designed seaside house of the Hollywood couple, who ooze the sort of confidence and casual intimacy that only the very rich seem able to afford. Although their lives are as sunny as a David Hockney painting, Lucas suggests, there's nearly always a serpent at the bottom of the sparkling pool.

There are some vertiginous swoops and turns in this psycho-sexual chess game; viewers are advised to pay close attention to even the most incidental scene or aside (listen carefully, for example, to a rushed, otherwise forgettable encounter at Jeffrey and Elaine's cocktail party). But the audience's extra effort is rewarded in "The Dying Gaul's" smart writing and nuanced performances, all three of which deliver surprises while the characters embark on their dangerous liaisons -- in which seduction and manipulation are pursued through that epistolary form of the 21st century, instant messaging.

With the help of cinematographer Bobby Bukowski, production designer Vincent Jefferds and composer Steve Reich, Lucas drenches each shot with beauty and dread; in many ways, "The Dying Gaul" unfolds like a fever dream of desire, betrayal, paranoia and revenge. Ironically, the real-life movie has come under the same knife as the fictional one: Lucas and Scott (who executive produced) seem to have succumbed to suggestions that they soften the film's ending. (One wonders whether Strand Releasing, the company that finally picked up "Dying Gaul," agreed to distribute the film contingent on the change.) Worse, the compromise didn't fix the real problem: a final whopper that is objectionable, not because it's too tough, but because its outlandishness is completely at odds with the film's rigorously controlled tone. Still, if Lucas oversteps in the final lap, everything that has gone before in "The Dying Gaul" suggests that he could be as formidable a talent in the cinema as he has proven to be on the stage.

The Dying Gaul (101 minutes, at Landmark's E Street Cinema) is rated R for strong sexual content and profanity.

Campbell Scott plays a Hollywood producer and Patricia Clarkson his screenwriter wife.