Anderson Cooper’s alleged stalker insisted he’s a good friend of the TV personality and believes he’s a victim of bullying by the CNN anchor’s boyfriend.

Accused stalker Alex Hausner believes he’s on good terms with Anderson — and even the famed broadcaster’s dog.

“I used to give Anderson presents for his birthday, and that was encouraged,” Hausner, 40, told The Post. “I dropped some dog treats off at his house. I got some dog treats for his dog and dropped them at the door.”

Hausner — in jail and charged with first-degree menacing and misdemeanor harassment and stalking — incredibly claimed that Cooper’s significant other Ben Maisani is the real offender.

Maisani “was actually stalking me, sending friends to stalk me,” said Hausner, who has been described as a gay, Jewish, white supremacist by friends.

Cooper, 46, was not available for comment at his West Village pad yesterday.

“It has nothing to do with Anderson. I can’t make that report, I told you,” Hausner said. “I can prove from my sources that his boyfriend has sent people after me.”

Prosecutors painted a scary — and completely different — picture of Hausner, who allegedly tried to kick down the doors of Cooper’s home on June 22.

The suspect wants authorities to believe he was invited to drop by.

“I was told to knock on the garage door,” Hausner said. “I might have got there at the wrong time. I knocked on the door and hit it with my foot.”

Then in a slightly more credible account, Hausner said he was confronted by Cooper’s head security guard, Howard Vincent.

“Finally I rang the bell,” Hausner said. “[Vincent said], ‘He doesn’t want to talk to you, man! What are you doing, Alex?’ ”

Hausner said he shot back, “You know what? This is bulls–t! I’m just doing what I was told to do!”

Hausner began stalking Cooper in 2008, with numerous phone calls the anchorman’s security team fielded, telling him to stay away, according to prosecutors.

The delusional Queens native and psych patient said he and Anderson have been friends with “romantic overtones” beginning in 2008.

“There was no time to get to know each other,” Hausner said. “I do love him, but we became more than just friends. ”

Hausner is being held in lieu of $75,000 bail. His lawyer said Hausner doesn’t have a violent history and poses no threat to Cooper. His next court date is Aug. 8.