The mother of “Grid Kid” murder suspect John Giuca lives next door to the Brooklyn professor slain by a home invader — and saved his wife and daughter from the intruder with text message warnings, she told The Post on Tuesday.

Doreen Giuliano, Giuca’s mom, said she quickly texted her neighbor Jennifer Hunter, the wife of 66-year-old Jeremy Safran — a professor of psychology at The New School in Manhattan — when she noticed a strange man creeping around the Prospect Park South home Monday night.

“He was looking left-to-right, left-to-right. And I’m watching him. And he went back to the alley and back to the door, and he’s looking left-to-right, left-to-right. And I’m like, ‘What is this man doing?’” said Giuliano, who lives just across the street from the couple on Stratford Road.

At 5:41 p.m., Giuliano texted Hunter, “Hi Jen it’s your neighbor Doreen. Do you have anyone working in your house today? I was just being a nosy neighbor and notice someone down your walkway where you have the garbage pails,” according to messages she showed The Post.

Hunter then responded: “Thanks. Someone has been poking around in our backyard. Did you see the person? What did he look like?”

Moments later, Giuliano sent an alarming text back: “Jen!! He went in the side door. He went into your house. He is still in your house. Maybe you need to call me…If you have no one in your home right now then you have an intruder do I call 911?”

That’s when Hunter and her and Safran’s 18-year-old daughter went outside and met Giuliano on the front lawn of their home as Safran was still inside, Giuliano said.

“I was screaming at her, ‘There’s a man in your house! There’s a man in your house!’ She said, ‘You know, it’s strange because my basement lights went out,’” Giuliano recalled.

“I said, ‘He’s in there, Jen.’ She goes, ‘Jeremy is around here somewhere’ — like she felt safe because her husband was somewhere in the house,’” said Giuliano. “She almost don’t believe it. I had to curse to wake her up [saying], ‘There’s somebody in your f–king house!’ … and meanwhile, he was in there killing Jeremy.”

Hunter then called the police, who quickly arrived on scene.

“We pointed to the door. They ran down,” Giuliano said, referring to the officers. “They were down there for a few minutes, then they came back up. Then we heard the scuffling, so we knew that they had found him.”

Safran was fatally attacked in the basement of the home near Hinckley Place by the burglar around 6 p.m.

Cops found an unconscious Safran on the floor of his basement with trauma to his head and body and a hammer lying next him. He was pronounced dead at the scene.

During their search of the basement, officers found his 28-year-old blood-soaked attacker hiding in a closet.

The man, whose identity was not released, was taken into custody and charges were pending.

“When they brought him out, he had blood all over his hands,” Giuliano said of the suspect.

“I believe that if I hadn’t seen him go in there, he would have stood there, waited, and who knows what would have happened to the ladies?” said Giuliano, adding that she believes the invader would have also gotten to Safran’s wife and daughter had she not warned them.

Giuliano added: “It just scares me half to death, because all this violence is going on right inside the house and no one even knows. The houses are so big. If you’re on the third floor, you don’t hear what’s going on in the first floor.”

Hours later, Giuliano sent a text to Hunter to check on her, asking if she was OK.

“Yes thanks!” Hunter responded to Giuliano, text messages show. “You saved us.”

Cops interviewed Giuliano and Hunter at the 70th Precinct late Monday.

Giuliano says she reviewed surveillance footage from her security cameras with police and saw the suspect pull up to the home at about 1:30 p.m. that day.

“He crossed the lawn and he tried their door. Then he went and sat inside his car from 1:30 p.m. to 5:30 p.m.,” she said.

At 5:30 p.m., Giuliano said, she saw the intruder walk to the side door of the home with a shopping bag and bring it to a black Lexus with Ohio plates parked outside the home and place it inside.

Giuliano has been relentless in her efforts to get her son released from jail. Giuca, 34, has been behind bars for more than 10 years for the 2003 killing of Connecticut college football star Mark Fisher.

Giuca’s conviction was overturned by an appeals court in February and he remains locked up on Rikers Island pending his retrial.