When Spike Lee came under fire last month for including 9/11 conspiracy theorists in his HBO documentary series “NYC Epicenters 9/11-2021½,” historians and others expressed disappointment that Lee had seemed to give credibility to long-debunked claims. (He subsequently edited them out.) But for those of us who’ve followed Lee’s career, and its intersection with that seminal New York event of 20 years ago, the initial decision was especially baffling — as Lee also directed what many consider the quintessential film about post-9/11 New York City.

“25th Hour” is not a “9/11 movie,” at least not in the way that “United 93” or “World Trade Center” are. In fact, the attacks were not part of the David Benioff screenplay that Lee signed on to direct, nor were they part of Benioff’s original novel (which was published in January 2001). But Lee is an intuitive filmmaker, open to improvisation and adjustments — and, as “NYC Epicenters” reminds us, he is a documentarian who saw his city in a moment of mourning, melancholy and transition, and wanted to capture it.

Most of Hollywood did not feel the same. In the weeks following the attacks, feature films with terrorism plotlines, including the Barry Sonnenfeld comedy “Big Trouble” and the Arnold Schwarzenegger vehicle “Collateral Damage,” were delayed and drastically re-edited. Films still in production, like “Men in Black II” and “Lilo & Stitch,” were rewritten to remove echoes of 9/11. Skyline shots with the World Trade Center were edited out of the not-yet-released “Kissing Jessica Stein,” “Igby Goes Down,” “People I Know” and “Spider-Man,” and a sequence of that superhero trapping a helicopter in a web between the twin towers — the centerpiece of a popular teaser trailer — was deleted as well.

Most controversially, some filmmakers chose to leave their skyline shots intact, but to erase the Twin Towers with digital effects. And thus the World Trade Center was wiped from “Serendipity,” “Stuart Little 2,” “Mr. Deeds,” and Ben Stiller’s “Zoolander,” which hit screens less than three weeks after the attacks. The director’s publicist explained at the time that he made the last-minute decision to remove the towers because the film was an escapist comedy and seeing the buildings “would defeat that purpose.”

Spike Lee disagreed. “You could not even show an image of the World Trade Center. I said, we’re not doing that.” With filming on “25th Hour” planned for the following winter, Lee set about weaving 9/11 “into the fabric” of the existing story, as his star, Edward Norton, explained on the audio commentary: “It was like looking at it through the angle of another story, but the melancholy that the city was full of in that year afterward. I feel like the impact of 9/11 emotionally is all through this movie.”

“25th Hour” is the story of Monty Brogan (Norton), a white-collar drug dealer whom we meet on the last day before he is to report for a seven-year incarceration. That night, he hits the town with his childhood pals (Philip Seymour Hoffman and Barry Pepper) and his live-in girlfriend (Rosario Dawson), ostensibly for one last blowout, but also in an attempt to come to terms with the choices — and thus, mistakes — he’s made in his life.

So the explicit references to the tragedy are minimal. There is the opening credit sequence, featuring the “Tribute in Light” art installation, in which 88 searchlights combined to create two beams representing the fallen towers (Lee said he filmed it the very night he read about it in The Times); accompanied by Terence Blanchard’s moving musical score, these images say far more about the tragedy than any news footage or expositional dialogue could. Occasionally, ephemera of that autumn — American flags, makeshift memorials, wanted posters of Osama bin Laden — pop up in the background.

One scene, lifted almost verbatim from the novel, finds Monty delivering a lengthy, angry, profanity-laden monologue into a mirror, meticulously insulting New Yorkers of every imaginable race, religion and class (before landing on his family, his friends and finally himself). Bin Laden and Al Qaeda were added to the list of his targets.

Most poignantly, Lee relocated a scene between Hoffman and Pepper to an apartment overlooking ground zero, and placed the actors in front of a large window to view workers sifting for human remains. “New York Times says the air’s bad down here,” Hoffman notes; Pepper disparages the paper (“I read The Post”) and insists, “E.P.A. says it’s fine.” (The federal agency was later revealed to have misled the public.)

Some of the film’s initial critics found these additions to be an intrusion — A.O. Scott deemed them “obtrusive” and “a little jarring.” But as the years have passed, the value of what Lee was capturing has become clear. On the film’s fifth anniversary, the film critic Mick LaSalle called it “as much an urban historical document as Rossellini’s ‘Open City,’ filmed in the immediate aftermath of the Nazi occupation of Rome.”

But Lee didn’t just capture the way New York looked in those uncertain, shellshocked months after 9/11. His film captured how the city felt, the strange quiet that fell over the streets, the overwhelming melancholy that embedded itself in our collective DNA. “25th Hour” was not the story of those attacks, but it was a story about one way of life coming to an end, and another, far less certain one looming on the horizon.

“We were very careful how we were going to portray Sept. 11 because we know it’s still very painful and that it will always be very painful for those who lost people,” Lee said upon its release in December 2002. “But at the same time, we couldn’t stick our heads in the sand and pretend like it never happened.” And that instinct, that insistence on documenting the city we lived in rather than the city we imagined, is what makes Spike Lee one of New York’s essential filmmakers.

Jason Bailey is the author of the forthcoming book “Fun City Cinema: New York and the Movies That Made It,” a history of the city and movies about it. He is also the host of the “Fun City Cinema” podcast.