Jake Rosenberg, a young playwright from San Francisco whose “Holocaust comedy” set in Auschwitz makes its New York premiere next week, says his biggest bout of nerves came when the play was performed for the first time in his hometown last year.

At the last moment, five elderly members of the audience took their seats, in the first row.

All were Holocaust survivors. “I saw their tattoos,” the numbers on their arms, Rosenberg told The Jewish Week in a recent interview.

He asked himself what they would think of “Muse of Fire,” his farce about a group of Auschwitz inmates who put on a play about the anti-Semitic trial of Alfred Dreyfus. Would they be offended? Would they walk out?

Rosenberg, who wrote the play as a senior project at the Jewish Community High School of the Bay, needn’t have worried.

The survivors stayed in their seats. “They were engaged. They were laughing at the jokes. They didn’t storm out,” said Rosenberg, 19, now a freshman at New York University’s Tisch School of the Arts.

The Holocaust survivors didn’t hang around after the play to discuss it with him, but he calls their “silent approval,” the fact that they did not seem to take offense at the play’s edgy approach to life in a death camp, “the highest compliment.”

Rosenberg, who grew up hearing about the Holocaust at home (his father’s side of the family was from Russia; his mother’s, from Rhodes) and at school, said memory of the Shoah was an ever-present part of his youth. “That was my heritage.”

He knew the basic facts. Then he came across an article online about concentration camp prisoners who used humor among themselves as a coping tool, as a form of spiritual resistance, as an escape from the daily horrors.

He was already interested in playwriting, but couldn’t figure out how to work comedy into a death camp setting, how to make the scenario accurate to the victims’ experience and respectful of the survivors’ feelings.

In class he studied the Dreyfus Affair, about a Jewish lieutenant in the French Army who was unjustly convicted of treason amid anti-Semitic hysteria, and an idea was born.

He would do a play within a play. It would work as a comedy. “I’m a funny guy,” he said, too apologetically to sound like a cocky teenager. “I like to make people laugh.”

A play about Dreyfus would have been a veiled way for Auschwitz prisoners to comment about the type of Jew-hatred that motivated the Third Reich, Rosenberg thought. The older prisoners in the death camp would remember the Dreyfus Affair. A lot of research, about Dreyfus and about Auschwitz, followed.

“Historical accuracy is very important to me,” Rosenberg said. There is no record of Auschwitz prisoners putting on such a play — but it could have happened. “It was plausible. It was a safe way to poke fun at the Nazis.”

He raised money for the New York staging of his play via the crowdfunding Indiegogo website. It was read in its early stages by a wide circle of friends, including Manhattan cousins Arlene and Ivan Utis.

“Muse of Fire” — the title comes from the first scene of Shakespeare’s “Henry V” — features an eclectic cast of characters. A gay man pretending to be Jewish. A Jewish director-playwright. A “Hungarian observant” Jew. And seven other assorted men who work together to do the play in the summer of 1942.

The inmates in Rosenberg’s Blok #12, the part of the barracks where the play is set, come from a variety of countries, speaking a hodge-podge of European languages. They quarrel among themselves. They trade sarcastic barbs.

A play about the Dreyfus Affair would have been a hit in the ghetto theaters, observes Haas, the gay Jewish-wannabe character, “Because if there’s one thing people couldn’t get enough of in ghettos, it was anti-Semitism.”

Says Georg, the Courtesy of Jake Rosenberg play’s playwright-director, “In Auschwitz, we have the freest theater in the Reich. Here we can actually laugh out loud at the jokes. In the theaters outside, the actors and the audience, they are frightened to laugh because they fear that they may end up in a concentration camp. That’s something we don’t have to worry about.”

Rosenberg’s play is filled with lines like that, political commentary in the guise of black humor.

His research convinced him that people in concentration camps, Jews and non-Jews, did joke like this. Often at the risk of their lives. “Absolutely,” he said. Mockery of the Nazis could mean instant death.

Such comedy offered a sense of control, Rosenberg said. “In a physical sense, it accomplished nothing. It gave them hope. It gave them dignity. They were taking agency of their lives.”

Rosenberg said he “grew very attached” to the characters he created.

How does he envision their eventual fate?

“They probably would have died.”

“Muse of Fire” is the latest example of the grandchildren and great-grandchildren of Holocaust victims memorializing the Shoah in ways that are more meaningful to them than the standard speeches and candle-lighting ceremonies favored by the survivor generation.

For the survivors and their children, humor as a form of Holocaust memory was a taboo. For Rosenberg’s generation, he said, the type of respectful irony he employs in his play is natural. “People get tired of the same stories. There are new ways to remember.”

Some survivors, like those who sat through his play in San Francisco a year ago, understand the therapeutic value of humor, he said. “For them, it was absolute necessity.” n

“Muse of Fire” will be staged at the Manhattan Repertory Theatre, 303 W. 42 St. in Manhattan, Oct. 29, Nov. 1, 2, 7 and 8. For information: (646) 329-6588; mannattanrep.com. For crowdfunding information: indiegogo.com/projects/muse-of-fire-at-the-manhattan-repertory-theatre.