A D.C. Superior Court judge last night postponed imposition of a new 6 percent tax on gasoline sales in the District of Columbia, scheduled to take effect today, to determine if the higher prices resulting from the tax would violate federal energy price regulations.

Judge William E. Stewart ordered a five-day delay after lawyers representing the Greater Washington-Maryland Service Station Association argued that if the tax -- about 8 cents a gallon at current prices -- were collected, it would leave service stations in violation of the federal pricing formulas.

Assistant D.C. Corporation Counsel Richard Amato initially contended that the dealers could begin collecting the new tax and that legal questions concerning the increase could be settled in court later.

But Stewart suggested that the questions of possible federal violations should be settled before the tax is imposed "to be fair to the dealers and Johnny Motorist." The judge then suggested that the city consider delaying imposition of the tax until the legal questions could be explored.

After a brief recess in the court hearing, Amato said that the city would agree to a five-day temporary delay in imposing the tax so that D.C. officials and representatives from the federal Department of Energy could examine the proposed gasoline sales tax for possible legal problems.

The tax was a major part of a $20.2 million package proposed by Mayor Marion Barry to help solve the city's worsening financial crisis.

In mid-June the Energy department ordered that gasoline station dealers could not charge more than 16.8 cents per gallon over their wholesale costs.

In implementing the new tax, the city government told service station dealers that they could add a flat 8 cents per gallon tax, rather than figuring the 6 percent tax on each sale.

The result, however, is that in some instances, a flat 8-cent tax could push the dealer's per-gallon margin over the federal limit of 16.8 cents, according to Malclm W. Houston, the lawyer for the service station operators.

If the dealer collects more than the amount permitted, he would have to reduce retail prices accordingly to fall below the 16.8-cent margin.

Gasoline prices vary by as much as 10 cents a gallon throughout the city because federal price regulations have affected different gasoline distributors in different ways.

In one example, Houston said that if the 6 percent tax were figured on 10 gallons of gasoline priced at $1.18 per gallon, the tax would amount to 70 cents, a correct figure.

However, Houston said that for the same amount purchased at $1.26 a gallon -- including 8 cents tax per gallon -- the total sale price would be $12.60, including 80 cents collected in sales tax.

That would give the dealer an unwarranted extra 10 cents and possibly place the dealer in violation of the federal price guidelines, Houston said.

Some taxicab operators, expecting financial difficulties to result from the increase in gasoline prices in D.C., said earlier this week that many of them would be driving to the Maryland suburbs to purchase gasoline whenever possible. One group of taxi drivers had scheduled a protest rally at the District Building for today to challenge the proposed tax increase.