A New Jersey man suspected of attempting to set a fire in St. Patrick’s Cathedral cased out the location a day before he was discovered late Wednesday trying to enter the venerable house of worship with flammable materials, a top law enforcement official said.

Marc Lamparello, 37, of Hasbrouck Heights, was charged with attempted arson, reckless endangerment and trespass in connection with his attempt to enter St. Patrick's with two canisters of gasoline, two containers of lighter fluid and two barbecue ignition devices, officials said.

During a briefing with reporters Thursday, NYPD Deputy Commissioner John Miller said Lamparello was prevented from entering the cathedral by an usher who then alerted police Critical Response Command officers who approached him and questioned his story about needing gasoline for his van.

The cops discovered that Lamparello’s van actually had gasoline and then took him into custody for further questioning, Miller said. Lamparello was awaiting arraignment late Thursday on the charges.

Neither Miller nor other officials gave a motive for the actions of Lamparello, who police said worked as an adjunct lecturer in the CUNY system.

Lamparello was arrested on Monday in New Jersey after he caused a disturbance and refused to leave Sacred Heart Cathedral in Newark following a short 9:20 p.m. Mass, said Essex County Undersheriff Kevin Lynch.

In the Newark incident, Lamparello lay down on the cathedral floor and didn’t want to leave until an assistant bishop came by and blessed him, Lynch said. Lamparello was charged with being a disorderly person, trespass and obstruction of the administration of law, Lynch said.

On Tuesday, Lamparello was seen on surveillance cameras walking around outside St. Patrick’s Cathedral, the top law enforcement official said. Miller noted that before coming to Manhattan on Wednesday, Lamparello booked a flight to Italy for $2,800 that was scheduled to leave at 5:20 p.m. on Thursday.