The daily hassle of alternate-side parking turned fatal for one Brooklyn driver Monday when his head became wedged between his minivan and a tree while backing into a spot, police sources said.

The freak accident happened around 9:45 a.m., as Xin Xheng Lin, 52, moved his vehiclem across West Seventh Street in Gravesend to avoid a ticket for blocking the street sweepers.

Instead of just using a rearview mirror, Lin stuck his head out of the door of his Toyota Sienna as he reversed into the spot, the sources said.

His skull got caught between the vehicle’s frame and a 30-foot London Plane tree — to the horror of witnesses on the block.

“There was blood coming out of his mouth,” said neighbor Mark Sarachik, 55, who watched EMTs attempt to save the man.

“They pulled him out of the car and put him on the floor. They tried CPR, they did oxygen, but there was no response. They put him in the ambulance,” said Sarachik, who had been moving his own car for alternate-side parking.

Lin, a father and Chinese émigré, was rushed to Coney Island Hospital, but the pressure on his brain was too intense to survive the tragedy, police sources said.

Lin’s wife, Mei Hong Jing, who worked with him at their nearby Gaung Tai 99¢ or Up dollar store, saw him covered in blood moments after the accident, according to Sarachik.

“I tried to console her,” he said.

Coworkers and customers were heartbroken over Lin’s death.

“It’s tragic. We were all very misty eyed,” one regular customer at his shop said. “He worked very hard for the American dream.”

A coworker also was choked up over the bizarre accident.

“I’m very upset, very upset,” said Mei Huang, 50.

“His wife is very sad. His son is only 7, almost 8 years old.”

The gnarled, 2-foot-thick tree that Lin’s head struck sits right at the edge of the curb, but does not protrude into the street.

“It was crazy because you don’t expect something like this,” Sarachik said.

“It’s a freak accident. Not every day someone gets pinned by their own car.”

Additional reporting by Natalie O’Neill