In the summer of 1969, upstate New York hosted the Woodstock Festival, drawing hundreds of thousands of people — overwhelmingly white — to hear some of the top rock acts of the day. That same summer, the city of New York hosted the Harlem Cultural Festival over the course of six weekends, drawing hundreds of thousands of people — overwhelmingly Black — to hear some of the top soul and R&B acts of the day.

The legend of Woodstock was enhanced by Michael Wadleigh’s documentary, which captured the scene, the rain, the mud, the drugs, the nudity, and the music for everyone who couldn’t attend. It played in theaters all across the country. The Harlem event was also filmed, by Hal Tulchin, but other than one New York TV station which aired excerpts late on some Sunday nights, no one was interested in exhibiting the footage, so it sat in a basement for 50 years. Now it has been rescued by Ahmir “Questlove” Thompson, drummer/leader of The Roots (house band for Jimmy Fallon’s “Tonight Show”), who compiled the footage into the documentary “Summer Of Soul.”

Among the acts featured are 19-year-old Stevie Wonder, who’d had a few hits in the 60s but was still a couple of years from the creative genius who produced four consecutive seminal albums in the 70s (“Talking Book,” “Fulfillingness’ First Finale,” “Innervisions,” and “Songs In the Key of Life”).

Then there’s The Fifth Dimension, who — according to original members Marilyn McCoo and Billy Davis Jr. — had an image problem in the Black community, which considered them a white group. That changed after the Harlem festival. One of the most joyful parts of “Summer Of Soul” is the expression on Davis and McCoo’s faces as they watch themselves in footage they’d never seen.

Though I’m well aware of Sly and the Family Stone, I hadn’t seen the band working a crowd like they do in “Summer Of Soul.” Questlove tracked down people who were there who remarked on how eye-opening Sly’s act was, with Black and white and male and female musicians who — unlike many of their contemporaries — weren’t wearing matching suits or outfits. Their look matched the changing fashion (and hair) sense of the Black community, but caught quite a few observers off guard. Six weeks later, Sly et al did it again — at Woodstock.

I’m not a fan of gospel music, but I have rarely seen anything like the duet by Mahalia Jackson and Mavis Staples on “Precious Lord.” The former wasn’t feeling well that day, so she passed the microphone to the latter, who was flabbergasted for a moment but then turned in such a boisterous, beautiful performance that it inspired Jackson to join Staples in raising the roof. The result is nothing less than stunning.

Questlove also includes footage of BB King, David Ruffin (who had just left The Temptations), Nina Simone, Abbey Lincoln and Max Roach, Herbie Mann, Hugh Masekela, future Mel Brooks punchline Mongo Santamaría, and the amazing vocals and choreography of Gladys Knight and the Pips. There are even a couple of minutes of comedian Moms Mabley and ventriloquist Willie Tyler (man, was he good!) with his dummy, Lester.

Great music documentaries don’t merely show us what happened on stage, but offer some perspective on the time and place. “Summer Of Soul” intersperses archival footage of the civil rights movement, the moon landing, and the assassinations of Martin Luther King, Malcolm X, and the two Kennedy brothers, as well as reminders of the drug problems, poverty, and police brutality that have, sadly, lasted well beyond that decade. Questlove also tracked down some festival attendees to talk about what being at the event meant to them, as well as the offspring of some of the performers who have died, who share what they’d been told about it by their parents.

At just under two hours, “Summer Of Soul” is a raucous, fun, energetic record of an important American cultural moment that most of us didn’t even know happened. I was happy for the history lesson and thrilled to see these brilliant bands and singers resurrected 52 years later.

That’s why I give “Summer Of Soul (…Or, When The Revolution Could Not Be Televised)” a 9.5 out of 10, placing it in the top tier of films I’ve seen this year — and in the pantheon of all-time great music documentaries. Opens in theaters and on Hulu tomorrow (July 2).