David Letterman’s pending “Late Show” retirement is a win-win for one lucky potential successor — his protege, Craig Ferguson.

“The Late Late Show” host’s contract with CBS automatically gives Letterman’s empty chair to Ferguson if he wants it, while awarding him $5 million if he is passed over, according to a Hollywood source who has been apprised of the details.

“Conan’s was a lot bigger,” the source joked of Ferguson’s contract, which expires in June.

Conan O’Brien collected $10 million thanks to his own “out” clause, after being passed over for “The Tonight Show” gig in 1993.

Meanwhile, a coast-to-coast tug-of-war played out this week, with pols in both New York and LA vying to keep or get geographic dibs.

LA is down one major talk show now that Jimmy Fallon has moved “The Tonight Show” from Burbank to the Apple.

“I look forward to speaking with you about the possibility of bringing the successor to Mr. Letterman’s show to Los Angeles,” LA Mayor Eric Garcetti wrote CBS Chairman Leslie Moonves.

“What better place for ‘The Late Show’ than The City That Never Sleeps,” City Council Speaker Melissa Mark-Viverito countered in her own letter to Moonves.

Even Gov. Andrew Cuomo weighed in with his own Top Ten list of reasons for the “Late Show” to stay on the Right Coast, including No. 6: “He contributed to keeping New Yorkers working by giving Paul Shaffer a steady job.”

Letterman announced last week that he’ll retire from the “Late Show” next year, after 32 years as host. CBS and Ferguson’s reps leapt into talks at the first word of the opening, insiders say.

Ferguson remains a succession favorite. His show has followed Letterman’s slot for nine years — and both shows are produced by Letterman’s production company, World Wide Pants.

Throwing his weight behind Ferguson would let Letterman’s company keep control of both slots.

But other names being bandied about by insiders include Neil Patrick Harris, whose “How I Met Your Mother” series has ended and whose turns as Tony Award host were warmly received.

Harris, now starring in “Hedwig and the Angry Inch” on Broadway, would give CBS a strong rival to Fallon’s musical and comedic chops, insiders say.

Speculation is also swirling over whether Moonves will try to smack away any succession attempts by rival Viacom’s formidable triumvirate of “Daily Show” talent — John Stewart, Stephen Colbert and alum John Oliver, the three most successful nighttime talk show hosts beyond broadcast television.

Any of the three would pull ad money and resources away from CBS and toward the cable giant, making such a succession unpalatable for Moonves, insiders speculate.

But both CBS and Viacom are controlled by Sumner Redstone, so “That would be an interesting conversation,” noted one source.