The squad had been deployed to crack down on the proliferation of illegal guns in that city. But prosecutors now say that Rayam and several cohorts, including two commanding sergeants, used their positions to rob drug dealers and pocket hundreds of thousands of dollars uncovered while searching homes and cars of suspected criminals.