Police say four of them were caught on the roof of the JK Deli on the corner of Kissena Boulevard and 71st Avenue in Kew Gardens Hills.
The incident happened just before 3 a.m. on January 3.
Police say the suspects broke in through the roof and cut a hole in the deli ceiling. After officers arrived and discovered the men on the roof, the suspects allegedly ran separate directions in an attempt to avoid apprehension.
One suspect was taken into custody in an elevator of an adjoining building, while two others were apprehended from trees adjacent to the building. The fourth suspect was apprehended by officers after a brief struggle.
Further investigation revealed a fifth individual involved in the burglary had been waiting in a nearby parked vehicle and was also placed under arrest.
No injuries were reported.
In addition to $12,000, they almost got away with 3,518 scratch-off lottery tickets, 162 packs of cigarettes and 49 boxes of cigars.
They were identified as 27-year-old Robert Martin, 25-year-old Jose Rosario, 21-year-old Christopher Aulet, 19-year-old Sean Martin and a 15-year-old minor.