The District government asked a federal court yesterday to phase in over four years federal labor laws that require state and local governments to pay overtime to police and firefighters, instead of giving them compensatory time off.

The lawsuit, filed in U.S. District Court here, says the 1974 amendments to the Fair Labor Standards Act, which the Supreme Court upheld in February, should be phased in using a four-year timetable similar to that approved by Congress when they were enacted.

The Labor Department said it will enforce the overtime requirements fully on Oct. 15, and said retroactive payments may be required from April 15. It said that the four phase-in periods specified in the 1974 law expired in 1978.

If the law is not phased in, the District said, its overtime costs for police, firefighters and other public safety employes, including corrections officers, would rise by 66 percent next year and amount to $7.6 million over the next four years.

A lawsuit similar to the District's has been filed by Los Angeles and repeal legislation is awaiting action in the Senate.

Under Labor Department regulations, police must receive overtime pay if they work more than 171 hours in a 28-day period. For firefighters, overtime must be paid after 212 hours in a 28-day period.