A long-ago feud between Queens neighbors involving allegations of trespassing and stalking of a preschool girl has resurfaced in a lawsuit accusing an NYPD captain of raping an officer.

Ex-NYPD Capt. Jeffrey Brienza — who is accused in a sex attack lawsuit brought by former NYPD Officer Gillian Roberts — moved with his family out of their home in Glendale after a neighbor accused him in 2006 of repeatedly sneaking up to his house to leer at his daughter when she was 3 and 4 years old.

The neighbor, David Broderick, says in an April deposition that he filed a complaint with the NYPD Internal Affairs Bureau and that investigators suggested that if he dropped the matter, they could have Brienza leave the neighborhood.

Brienza’s home was sold in 2007, according to records.