Jerry Brown with Johnny Carson in 1979. (via Facebook)

Neel Kashkari, the Republican nominee for governor, released an ad Wednesday in which he went to Fresno with just $40 in his pocket to look for work, to test whether the state’s economy has improved since his opponent Gov. Jerry Brown (D) took office in 2011. Brown’s campaign dismissed it as a stunt, but Brown himself has done something along the sames lines before.

In 1977, when he was governor for the first time, Brown showed up unannounced to a tenement building called “The Pink Palace” in San Francisco, where he met residents and stayed the night, according to an Associated Press report from the time.

“I get firsthand knowledge uncensored by the normal channels,” he told the AP. “In my position, much of the information is filtered.”

He also visited state prisons and mental hospitals and went on a graveyard-shift police patrol.

“Brown says he gets a more accurate view of how things are working, ‘or very often, how they are not working,’ by bypassing the bureaucracy and the advocates of special interests and going directly to the people,” the AP wrote.

Kashkari said in an interview with The Post that he wished Brown would do visits like that again.

“I think it’s great,” he said. “I think it’d be great for the governor to get out of his cocoon.”

Kashkari said before filming in Fresno, he had also stayed in a homeless shelter for a night in Oakland last year and worked alongside migrant workers.

“I was looking for ways to bring the issues to the forefront,” he said. “I only got a sliver of a taste of what they were experiencing because I knew at the end of the week, I’d get to go home.”

Dan Newman, a spokesman for Brown’s campaign, called Kashkari’s ad a “cynical stunt” and a “campaign gimmick,” and said Brown and Kashkari’s experiences differed.

“Gov. Brown has spent a lifetime involved in these issues,” he said in an e-mail. “Kashkari is a multimillionaire banker who put on a costume and a duct-taped backpack and posed as something he isn’t.”

Newman also said the message of the video contradicts Kashkari’s platform.

“The stunt was particularly cynical because his entire campaign platform and experience contradicts his supposed interest in the issue,” he said. “He has steadfastly refused to help struggling homeowners, unemployed Californians, and the working poor.”

Kashkari is currently behind Brown by about 20 percent in most polls taken since the primary, according to the Los Angeles Times.