Federal authorities have accused New York City officials of a five-year effort to defraud Medicaid, working with a contractor to exploit loopholes in Medicaid’s computerized billing system to collect reimbursements that amounted to tens of millions of dollars.

The office of Preet Bharara, the United States attorney for the Southern District of New York, said on Monday that the city’s Department of Health and Mental Hygiene and the contractor, Computer Sciences Corporation, created schemes from 2008 through 2012 that would produce reimbursements on tens of thousands of false claims for early intervention program services for infants and toddlers.

In one scheme, the city and the firm switched diagnosis codes on children, using a default code — 315.9, which designates an “unspecified delay in development” — that Medicaid would approve, the prosecutor’s office said.

Other schemes were intended to circumvent Medicaid rules that required the city and the computer firm to exhaust private insurance coverage before billing Medicaid, Mr. Bharara’s office said.