A former New York City Law Department attorney admitted Friday that he had defrauded two victims in a mortgage scam to pay off gambling debts.

Hugh A. Zuber, who worked in the Law Department’s special federal litigation division, pleaded guilty to two counts of mail fraud before Southern District Magistrate Judge Andrew Peck.