Like his greatest creation, F. Scott Fitzgerald aspired from childhood to fly high. As a toddler, his very first word was “Up” — a bit of babble that seemed prescient when his first published novel, “This Side of Paradise,” became a soaring bestseller in 1920. The 23-year-old author and his 19-year-old bride, Zelda Sayre, were elevated to the pinnacle of Jazz Age fame.

But like Gatsby, Fitzgerald fell from grace quickly and catastrophically. During the Great Depression, when proletarian fiction was all the rage, Fitzgerald’s novels and short stories — mistakenly read as exaltations of wealth — were unpopular. Broke and sick from tuberculosis and alcoholism, Fitzgerald struggled throughout the 1930s to pay for boarding school for his teenage daughter, Scottie, and hospitalization for the mentally ill Zelda.

Thus it was that, in 1937, Fitzgerald struck a deal with the devil. He moved to Hollywood to work as a screenwriter — primarily for MGM. For the last 3 1/2 years of his life, Fitzgerald was treated as little more than a “hand” by the likes of movie moguls who would have seen Gatsby’s signature the symbol of the green light as nothing more than the color of money.

That grim yet undeniably fascinating last act of Fitzgerald’s life is the subject of Stewart O’Nan’s gorgeous new novel, “West of Sunset.” As he has demonstrated in “Last Night at the Lobster” and “Emily, Alone,” O’Nan is a writer alert to the courage and beauty inherent in the stories of people who simply have to keep on keeping on. What interests him about Fitzgerald’s exile in Hollywood is not so much the glitter (although Humphrey Bogart, Marlene Dietrich and other stars make appearances), nor his love affair with gossip columnist Sheilah Graham (whose blond good looks evoked the young Zelda), but rather Fitzgerald’s anxious commitment to his work as a screenwriter. Most of the movies Fitzgerald was assigned to were dreck (although there was a short stint on “Gone with the Wind”). Nevertheless, sitting down every day in his office or the various furnished cottages and apartments he rented in and around Hollywood, Fitzgerald fueled himself with cigarettes and Cokes (or, frequently, something more potent) as he labored to make flimsy scripts better. Fitzgerald was always a worrier, relentlessly tinkering with “The Great Gatsby” and “Tender Is the Night,” even after the publication of those novels. It’s that F. Scott Fitzgerald — the worn-out yet relentless craftsman — whom O’Nan compassionately evokes in “West of Sunset.”

In the spring of 1937, after taking his leave of Zelda, who remained institutionalized at Highland Hospital in Asheville, N.C., Fitzgerald boarded the Argonaut train out of New Orleans and rode cross-country. When he arrived at the Writers’ Building (mordantly dubbed “the Iron Lung”) on MGM’s lot, he was glad to discover friends from the old days such as Dorothy “Dottie” Parker, her husband Alan Campbell, and humorist Robert Benchley ensconced down the hall. O’Nan clearly has fun improvising snappy dialogue among these noted wits. Here’s a scene in which some of Fitzgerald’s fellow literary wage slaves clue HIM in to how things work at the studio after he has abruptly been taken off one picture (“A Yank at Oxford”) and assigned to another (“Three Comrades”):

“West of Sunset,” by Stewart O'Nan, is a novel about author F. Scott Fitzgerald. (Viking)

“ ‘It doesn’t matter what you write for [producer Joseph] Mankiewicz,’ Oppy [veteran screenwriter George Oppenheimer] said. ‘He’ll make it about the girl.’

“ ‘And slap a happy ending on it,’ Dottie said.

“ ‘Leave ’em laughing about Hitler,’ Benchley said.

“ ‘Mank’s like Jane Austen,’ Alan said. ‘It could be Hitler, Franco and Mussolini. By the end they’re all getting married. . . .’

“Scott laughed along with them, but still, he was disappointed. He wasn’t used to having his work dismissed, the long days and weeks of fretful effort he’d devoted to it wasted, fruitless. He’d come west not just for the money but to redeem his previous failures here. . . . What puzzled him most was that, until this morning, he thought he’d done a decent job.”

Note O’Nan’s smart choice of narrative voice. That third-person omniscient narrator dramatizes Fitzgerald’s characteristic insider-outsider stance and allows readers access to his imagined thoughts without overstepping the bounds of the plausible.

O’Nan packs his homage to Fitzgerald in decline and Hollywood at its zenith with period details: grilled cheese dinners at Schwab’s, dancing at the Cocoanut Grove, bacchanals presided over by Bogey at the notorious Garden of Allah hotel complex, where Fitzgerald briefly lived. Similarly, the plot of this novel sticks close to the well-documented facts. (Fitzgerald’s voluminous letters — some of which are cited here — are a primary inspiration. )

As Fitzgerald fans know, he began working on a novel about Hollywood during his tour of duty there, but a heart attack — probably his third — cut short his life and career at age 44. “The Love of the Last Tycoon,” even though unfinished, is a pretty fine Hollywood novel. “West of Sunset” is a pretty fine Hollywood novel, too, but it’s an even finer novel about a great writer’s determination to keep trying to do his best work, to keep reaching for “the silver pepper of the stars,” even at a time when he was universally dismissed as a has-been.

Corrigan is the book critic for the NPR program “Fresh Air” and the author of “So We Read On: How ‘The Great Gatsby’ Came to Be and Why It Endures.”

On Wednesday at 7 p.m., Stewart O’Nan will be at Politics & Prose, 5015 Connecticut Avenue NW.

WEST OF SUNSET

By Stewart O’Nan

Viking. 289 pp. $27.95