When Paul McCartney organized the mammoth “Concert for New York City” after the 9/11 attacks, the first performer to take the Madison Square Garden stage was David Bowie, singing Simon & Garfunkel’s “America” and his own iconic song, “Heroes.”

McCartney yesterday paid tribute to his friend, who died from cancer on Sunday at 69, by sharing a picture of himself and Bowie taken by his late wife, Linda McCartney.

“His star will shine in the sky forever,” Paul McCartney wrote.

And also in New York.

Bowie, who lived in SoHo, was both a musical legend and “a super New Yorker,” said Paul Levinson, a Fordham University pop culture professor and science fiction writer.

Bowie’s showmanship, imperial style, boundless energy, capacity for endless self-invention and fluid gender identification were collectively at one with a dynamic metropolis that is also forever reinventing itself, said Levinson.

A boundary-breaking musician, composer and actor, Bowie was “cosmic and universal,” but also epitomized the misfit or renegade (“Rebel, Rebel”) who refused to be typecast or defined by others, Levinson said.

“He was the champion of the misfits and everyone in New York has felt like a misfit,” said Brittany Griffin, 28, a Greenpoint costume designer who came to Bowie’s SoHo home to drop off a bouquet at a makeshift memorial Monday.

Androgynous and chameleon-like, Bowie was an icon to the city’s LGBTQ community, said Janice Wilde, a 61-year-old filmmaker from the East Village, as she stood outside Bowie’s Lafayette Street loft.

“We listened for hours. We listened for days. We listened for years. We’re all still listening. The music just spoke to you in a way that others didn’t,” she said.

Wilde added that her favorite song was “Changes,” and called Bowie’s androgynous appearance “just beautiful.:

Indeed it was, agreed Fred Bass, 87, the co-owner of the Strand bookstore, a favorite haunt of Bowie’s. “

“He was a good looking guy: No doubt about it,” said Bass. Even his casual clothes boasted bespoke British tailoring (“they fit him really well”) and Bowie cut a chic and elegant swath as he wandered unmolested through the miles of tomes in the Union Square store.

“He had big tastes. Wide tastes. He was in every section of the store and spent quite a bit of time here hiding and browsing,” especially in the art and history departments, said Bass, who recalled Bowie asking for a non-fiction book about American politics.

Bass is forever grateful to Bowie for his habit of schlepping his personal items in a Strand shopping bag. “He always walked around with a Strand tote bag! He gave us big publicity!” as a result of being photographed with it, Bass said. Books by and about Bowie were selling briskly Monday, Bass noted, adding wistfully: “He was a really intriguing guy.”

Levinson, who is 68, said New Yorkers in their 50s and older particularly feel this loss, as Bowie was a part of their coming of age and managed to stay relevant long past the youth-obsessed music industry’s standard sell-by date.

“He was a half-generation later than the Beatles: He died too young and he had so much more to do,” Levinson said.

Bowie played Madison Square Garden and Carnegie Hall, but the star also frequented departed iconic music venues such as the Mudd Club, Max’s Kansas City and Studio 54.

“Lazarus,” the show based around Bowie’s songs now playing at The New York Theater Workshop, was extended with additional performances to play through Jan. 20 on Dec. 7.

“Everyone at NYTW and Lazarus is deeply saddened by the loss of one of the great artists of our time. We are very fortunate to have had the opportunity to collaborate with Mr. Bowie on his theatrical piece, ‘Lazarus,’ and we look forward to honoring his work onstage as ‘Lazarus’ plays its final performances,” Jim Nicola, the Artistic Director of NYTW, said in a statement.

Accolades also poured in from politicians. “This is a sad day,” said Mayor Bill de Blasio, who said he enjoyed “many, many wonderful songs” by Bowie with “Young Americans” resonating particularly. The mayor described Bowie as “a guy who did a lot of good in the world.”

“We lost a brilliant, pioneering artist – and a great New Yorker,” tweeted former mayor Michael Bloomberg.

Madonna posted a passionate and personal encomium on her Facebook page that began “I’m devastated.” The pop star described Bowie as ironic, mysterious, unique and provocative and she thanked him for the critical role he played in inspiring her in her own career.

Bowie’s manager, Tony Visconti, described Bowie’s latest album “Blackstar,” which Visconti co-produced, as “his parting gift.” The first words of the single “Lazarus” are, “Look up here: I’m in heaven.”

“David always did it his way and his way was the least obvious way,” Visconti said in a statement.

(With Ivan Pereira)