Thirteen public housing authorities yesterday sued the Department of Housing and Urban Development to block the government's effort to take back more than $14 million in federal subsidies given the agencies in the last five years.

The lawsuit in U.S. District Court here alleges that HUD is changing its rules retroactively by trying to recoup money it has awarded the public housing authorities since 1980. The suit says this would have a "devastating" impact on public housing, with losses estimated at $6.3 million for Newark, N.J., $2.4 million for Minneapolis, $2 million for Boston and $1.1 million for New Haven, Conn.

HUD has contended that these and other public housing agencies overestimated their income at the beginning of each year, leading to overpayments by HUD, which pays about half the costs of each local agency. The local housing officials say that the overestimates were unintentional and that it is unfair to penalize them because their investments often yielded higher returns than expected.

Robert McKay, executive director of the Council of Large Public Housing Authorities, which filed the suit, said HUD is "disregarding the fact that funds received in those years were used to cover essential and authorized expenditures."