First he tackled guys in their 20s living the fantasy life in Hollywood. Now “Entourage” creator Doug Ellin is ready to grow up a bit with a new HBO pilot to star Ed Burns that revolves around a group of male friends in Gotham who’ve just hit 40.

Ellin wrote and will exec produce the half-hour pilot, tentatively titled “40.” It’s expected to lense in the fall in New York. Project marks Burns’ first foray into a role as a TV series topliner after being courted by numerous nets for years.

Ellin said he’d long wanted to do a show revolving around men dealing with marriage and friendships. But when the economic meltdown hit in 2008, he was inspired to focus on a world where men who thought they were set financially suddenly faced a harsh new reality.

“It’s something I’ve lived with my friends,” Ellin told Variety. “People were thinking that 40 is the new 20 and their life is all set — and all of a sudden they woke up one day and had no money.”

The show will focus on four friends who grew up together facing different situations in their personal and professional lives. Burns will play a Wall Street maven with a strong pedigree who endures major upheaval when the bank where he worked for 20 years collapses. Casting for the other key roles, including several femme characters, is about to get under way.

The “40” project is the first new series Ellin has fielded since “Entourage” bowed in 2004. He wrote the pilot script last year but felt strongly about remaining at the helm as showrunner throughout the show’s run on HBO, which wraps later this year with the laffer’s eighth season.

“It’s important to me to finish (‘Entourage’) strong,” he said.

There’s still some chatter about an “Entourage” feature, but for now his focus is on seeing the series through and getting “40” on its feet.

Ellin wrote “40” with Burns in mind for the key role. Burns has guested several times on “Entourage” (his brother, Brian Burns, worked on the series as a writer-producer for several seasons). Most importantly, Burns knows well the world that the characters in “40” inhabit, Ellin said.

“We’re both Long Island guys,” Ellin said. “We all know these guys who make a little money, move to Westchester and now are rolling in a world that they can no longer afford.”

Burns just finished shooting Summit’s “Man on a Ledge” and the indie “Friends with Kids” with Jon Hamm and Jennifer Westfeldt. Last year the hyphenate wrote, directed and starred in “Nice Guy Johnny,” which preemed at the Tribeca Film Festival and was distribbed on video-on-demand and iTunes by Cinetic Media’s Film Buff banner.

Ellin and Burns are repped by WME. Burns is also repped by Brillstein Entertainment Partners and Hirsch Wallerstein.