At one point, she managed to break free and flee the apartment, chased by Gonzalez, who again yelled threats toward her.
The neighbor scooped up the 4-year-old girl and ducked into her own apartment, fearing for her life, according to police.
By the time police arrived, Gonzalez was gone. A Danvers police dog tracked him to the corner of Highland Avenue and Cabot streets, then lost the scent.
A witness told officers that he had seen a man fitting the description given out by police getting into a cab heading for Salem.
The victim told police the attack came after Gonzalez heard her on the phone speaking with the father of the girl about some financial help. She said Gonzalez told her that he would kill her and then himself because he had nothing to live for.
Gonzalez was subsequently arrested on a warrant.
Courts reporter Julie Manganis can be reached at 978-338-2521, via email at email@example.com or on Twitter @SNJulieManganis.