With help from the Black Keys’ Dan Auerbach, New Orleans music great Dr. John’s new album, “Locked Down,” oozes with the mystique of his older work. (Joshua Black Wilkins)

For over four decades, Dr. John has served as ambassador of New Orleans music, introducing outsiders to everything from Basin Street blues to second-line rhythms and Mardi Gras anthems. His two-dozen-plus albums often resemble a musical museum, taking music born in dangerous places — from drunken bacchanals to the Storyville brothels where Jelly Roll Morton misspent his youth — and making it safe for polite society.

But there was a time, back when session musician Mac Rebennack dubbed himself “Dr. John, the Night Tripper,” when his music was anything but safe and clean. The Dr. John experience was, well, unsanitary. Scary. “Lewd and lascivious,” in the words of the St. Louis prosecutors who arrested his nude backup dancer and live-chicken-biting sideman.

The few LPs he cut during this period — “Gris Gris” chief among them — ooze mysterious energies. Their voodoo funk is treasured by many fans who have no time for his post-’70s output. On his new album, “Locked Down” (to be released by Nonesuch on Tuesday), that old Dr. John resurfaces, courtesy of Black Keys guitarist Dan Auerbach, who produced the sessions.

“It’s very spiritual how the whole thing went down,” Rebennack says, recalling how his granddaughter gave him a Black Keys record, which he liked, and then “next thing I know, he pops into my life.” Auerbach recruited Rebennack for a “Superjam” at the 2011 Bonnaroo fest (the festival’s name comes from an old Dr. John album), pairing him with a crew of young musicians steeped in the raw, bluesy aesthetic found on Black Keys records.

Within months they were all in a Nashville studio, starting with nothing and improvising building blocks for “Locked Down.” Only later would lyrics and melody be added. Auerbach “knew I had this little bag of poetry stuff that I write all the time,” Rebennack said, and he helped shape that material into a thematic sequence that follows the singer from outlaw posturing (“Ain’t never was/Never gonna be/Another big shot like me,” he boasts) through to more spiritual and paternal concerns. The process was unusual but not uncomfortable. “I don’t have no one way to write songs,” Rebennack said. “I’ve writ songs with so many people, over a lot of years.”

Rebennack’s syntax, readers will note, is richly off-kilter. His patois is also littered with nonexistent words, effortless bits of color that occasionally have a purpose beyond decoration. When recording songs derived from actual voodoo rituals or secret societies, obscuring the source material can be a sign of reverence. Appearing as himself on HBO’s “Treme,” he once alluded to the hazards of recording traditional Mardi Gras Indian chants; on the “Locked Down” track “Eleggua,” he recalled, he couldn’t bring himself to use the exact language of ceremonies he’s known since his youth.

“I did some mispronounciations of stuff here and there,” he said, tweaking the word “mispronunciation” itself, “just to respect what the Reverend Mothers had taught me back in the game.” Rebennack, a longtime voodoo practitioner who said he has “had a lot of titles in the Church over the years,” said he doesn’t “think it would be correct” to put the real thing in a song. “But I did more of the real maneuvers than I ever have in the past.”

Even so, Rebennack seems to chafe at questions about the authenticity of his late-’60s stage show, where glitter and smoke bombs added to the mystique of the “Night Tripper.” “It was very authentic,” he said, comparing the gyrations of his body-paint-wearing nude dancer to “things that might happen in voodoo, where they’re taken by a spirit.” As for Prince Kiyama — who would bite a chicken’s head off, then make the bird seem to disappear by tossing it to an enormous black snake that ate it whole — Rebennack noted that the “chicken man” had a well-known New Orleans church “where they sang, ‘Kiyama drink the blood! Kiyama drink the blood!’ And he would drink it. It’s what he did.”

Pressed slightly about the sideshow nature of this ritual, Rebennack elaborated: “Look, he was a funny guy. He used to go into Buster Holmes’s restaurant, which was a famous red-beans-and-rice place in New Orleans, and he would take his hat off with that snake in it. People would get away, and he’d have a place to sit! And then he’d put his hat back on with the snake still in it.”

“It was a big snake to have in your hat,” he said, laughing. “I don’t know how he did it. That snake loved him. He had another three or four snakes that he kept in his pad — they got to eat a lot of chickens.

“Where you gonna find people like that? This world is missin’ it.”

So far, Auerbach seems content to resurrect the Night Tripper’s grimy sound and leave the theatrics behind. But Dr. John’s upcoming stage plans are anything but low-key. He’s taking over the Brooklyn Academy of Music this spring with “Insides Out,” a nine-night, guest-laden gig broken into three themed shows: one featuring the “Locked Down” band, one heavy on New Orleans R&B stars and one dedicated to Louis Armstrong.

“I’m trying to give props to Pops,” he said of that last project, using one nickname of the New Orleans trumpeter who was himself often dismissed as a mainstream crowd-pleaser late in life, despite his trailblazing youth.

“I think we’re all supposed to give props to our elders,” said Rebennack, now two years older than Armstrong was when he died. Fortunately for Auerbach and like-minded fans, sometimes those tributes can come while their object is still around to participate.

John DeFore is a freelance writer based in New York