Police say Wilfi Rosario Rodriguez broke into the home in April, after the 56-year-old female victim discovered her Staples Street home had been entered.
Investigators were searching for a suspect based on a handprint found on a window in the home.
They were able to identify Rodriguez while he was being held at a Suffolk County court on non- related charges Tuesday.
Rodriguez is charged with second-degree burglary.