On a recent Wednesday, at about 8 p.m., New Village Cafe on Polk Street opened its doors to customers. Only now, and for the next few hours, it was called Compton’s Cafeteria. The menus said so — and so did the man behind the counter, dressed in all white, and the waitresses in their bright-yellow dresses, starched aprons and rolled socks.

A big lighting rig was suspended over the tables as customers got settled and started salting their potatoes.

“Love your dress,” a waitress said to one woman in a blue number with black polka dots as she showed her to a table.

“Off the rack!”

The atmosphere all this was meant to evoke was that of a popular late-night spot in the Tenderloin some 50 years ago, a place called Gene Compton’s Cafeteria, located at Taylor and Turk streets. The cafe sold coffee for 5 cents a cup. It was also one of the few places in the city where transgender women, hustlers, sex workers and drag queens could hang out, check on each other, relax a little. “When I was there, the muscles in my shoulders relaxed,” as one woman put it.

Then, on a warm August night in 1966, it became the site of one of the first documented acts of militant queer resistance. A saltshaker shattered a window, a nearby newsstand went up in flames, and a patrol car was destroyed. All this happened three years before the Stonewall Riots in New York City, which have largely been credited as the beginning of the modern gay rights movement. Still,the Compton’s Cafeteria Riot remains relatively unknown beyond a certain set of people.

That’s partly why, every weekend for the next few weeks, New Village Cafe is being reimagined as Compton’s and becoming a stage for an interactive play about the events leading up to the riot.

“I want anybody who is younger than I am to understand, really understand, that anything they may enjoy today or benefit from, they’re doing it on the shoulders of the characters in our play,” says Donna Personna, one of three people who wrote “The Compton’s Cafeteria Riot.” “It’s easy to take what you have for granted. But I think it’s best to know where your rights came from.”

The riot started making its way to stage a couple years ago, after Mark Nassar, a playwright and one of the co-creators of “Tony n’ Tina’s Wedding,” moved to the city. A friend took him on a tour of the Tenderloin, and he was immediately taken. “I was fascinated with the neighborhood because it reminded me of New York in the early ’80s.”

Before too long, Nassar found himself wandering around the Tenderloin Museum, looking for stories in its exhibitions that might be told with actors in an immersive setting. That’s when the museum’s director, Katie Conry, pointed out the story of Compton’s Cafeteria. In that story, Nassar saw all the elements of drama.

Through the museum, which helped produce and secure funding for the project, Nassar also met Personna and Collette LeGrande, two trans women who frequented Compton’s back then but weren’t present for the riot. The two came on as co-writers to lend their memories and experiences to Nassar, a straight man who had very little knowledge of the communities he hoped to write about.

The Compton’s Cafeteria Riot was almost lost to history until historian Susan Stryker found mentions of it buried in the archives of San Francisco’s GLBT Historical Society. She was able to uncover enough to produce a documentary about the event called “Screaming Queens: The Riot at Compton’s Cafeteria,” but the details of what exactly happened that night — beyond the general contours of growing unrest finally bubbling over — are difficult to know as fact.

As a result, this play mines trans history — as well as Personna’s and LeGrande’s real-life experiences — and attempts to imagine what might have happened that night. “We can only imagine what lit it up,” LeGrande says. The three of them met at least once a week, hours at a time, for more than a year. “We’d just sit there and have lunch and shuffle ideas and memories around, and all of a sudden it started coming together.”

Even if the play can’t claim historical accuracy the way a textbook might, the stories are true enough, Personna says. “I wasn’t there, but I knew the girls. Everything that happens in this story, in this play, it is the truth. It happened. But we configured the things.”

The story of Compton’s Cafeteria is a delicate one— Conry at the Tenderloin Museum and the three writers knew this. And representation is a fraught subject now more than ever, especially when so few stories about trans women make it to broader audiences. After a draft of the play was done, the museum held several community discussions to work it over. “We really took those notes and thoughts seriously,” Nassar says. “It was an awakening to delve into this world.”

And even then there were still things that needed changing. The director, AeJay Mitchell, brought his life experience as a black queer man to the project. The challenge, he says, was balancing historical accuracy with making room for current sensibilities.

Mitchell also wound up asking a lot of questions. Why is a white person starting the riot, when it’s well established that trans women of color led the charge at places like Stonewall? Why was Nassar listed first in the writing credits, when much of the material came from the lives of LeGrande and Personna? “I kept asking questions,” Mitchell says. “When (Nassar) was open to these sorts of discussions, I knew he was a person I could work with.”

What they wound up with is a play, with a largely transgender cast, that unflinchingly examines the lives of queer and transgender people living in the Tenderloin at the time. The piece depicts inter-community struggles and violence along with the privileges of “passing.” There are queer people in the play who are political and others who just want to make it through the day. There are moments of racism and trans phobia. The play, while funny at times, is also difficult to watch at others. “I want San Francisco to really see the importance of trans folks, and trans women in particular, in the queer narrative,” Mitchell says. “Trans women have paved the way for queer resilience.”

The production has faced some pushback as it starts its four-week run. One group has encouraged trans people who might be interested in the play to be prepared for some of the more triggering aspects of the story — or to avoid it altogether.

Jaylyn Abergas, a transgender actor who plays one of the leads in the production, remembers some of the criticisms about the play at an early question-and-answer session, critiques about trans misogyny and trans aggression.

The comments shook her. “It was difficult for me,” she says “because it’s a true story.” She’s too young to remember those times, but she’s old enough to know a little about the sorts of experiences on which the play is based. “It’s true to what the story is, and it’s important to tell that story.”

After opening night, Abergas found herself at a bar with some other castmates, celebrating the debut. She was feeling emotional, “thinking about all these struggles.” Another actor came over and started telling Abergas about how one of the characters was based on a trans woman they both used to know, a local performer who has since died and who used to pop into the salon where Abergas works just to chat.

Abergas realized the wig she wears in the play (in a particularly pivotal and emotional scene) actually used to belong to that woman. The connection hit her in that moment as she sat at the bar. She was helping to tell the story of a woman she knew so well, while wearing something that used to belong to her. The past and present, pressing into one another.

“It just made me feel like I’m doing the right thing,” Abergas says. “I am doing the right thing at the right time.”

Ryan Kost is a San Francisco Chronicle staff writer. Email: rkost@sfchronicle.com. Twitter: @RyanKost

The Compton’s Cafeteria Riot: Through March 17. $60. New Village Cafe, 1426 Polk St., S.F