Mayor Marion Barry called last night for immediate repeal of his highly controversial 6 percent tax on gasoline sales in the District of Columbia in the face of vigorous protests from Washington motorists and from cash-pinched gasoline dealers who said their customers were taking their business to Maryland.

Barry said there was "overwhelming evidence" to indicate that the tax, imposed in August as part of a $20 million tax package designed to help bail the city out of its budget crisis, has not worked. It has "caused undue hardships both on the consumers of gas in our city and those who operate retail gas businesses," the mayor said.

In place of the tax, Barry proposed an immediate one-cent increase in the city's excise tax on gasoline, which is currently 10 cents per gallon. That tax would increase by an additional two cents June 1, 1981. The 6 percent tax added about eight cents to price of each gallon of gasoline, at current rates.

Barry acknowledged that the new tax, which the mayor asked the City Council to act on at its meeting today, would raise less than the $13 million a year the sales tax was expected to yield.

He said the additional revenue would be recovereed through the seizure by the city of unclaimed bank accounts which was approved by the City Council earlier this month.

City Council member John A. Wilson (D-Ward 2), chairman of the council's finance and revenue committee, said the change is likely to be approved. "There shouldn't be any problems with the change," Wilson said. "My position in the first place was that we didn't want to do it, but we went along because he's [Barry] the leader. But I think there's been pressure on everybody to change it."

A survey taken by the city showed that during the first three months that the tax was in effect, gasoline stations in the city ordered about one-third less gasoline than a year earlier -- suggesting that their sales had fallen off considerably.

During that same period, orders in both Maryland and Virginia also decreased, but by far smaller margins -- 4.3 percent in Maryland and 9.5 percent in Virgina.

"When you cause economic hardship and maybe a loss of jobs, then you have no choice. You've got to change your mind," Barry told a reporter last night. "One thing we've learned is that we should never get more than five cents out of line with Virginia and Maryland." The sales tax had driven the disparity between Washington and suburban gas prices to as much as 14 cents a gallon in some instances.

Barry said it had been difficult to collect the sales tax revenues from District service station owners. He said the new tax would be easier to collect because it is paid by the wholesalers and there are fewer wholesale dealers in Washington then retailers.

Vic Rasheed, president of the Greater Washington-Maryland Service Station Association, praised Barry's decision and predicted it would "save quite a few gasoline dealers from impending bankuptcy."

"This is very welcome news for both the motorists and the dealers," Rasheed said. "I think everybody is going to benefit from lifting the tax. I think the whole business community suffered because of it."

A new law passed by the city government and now pending before Congress allows the city to collect funds deposited in city banks that have been inactive for at least seven years. Barry said yesterday that as much as $30 million in such funds could be obtained in two years.

After that, Barry said, the revenues from such accounts would drop to about $1 million a year. At that point, the mayor said, an alternative revenue source will have to be enacted. The mayor declined yesterday to say what that source would be.

Barry said yesterday that in addition to Wilson, Council Chairman Arrington Dixon and council member John Ray (D-At Large) also supported his request for repeal of the sales tax.

Dixon was unavailable for comment yesterday. Ray, who argued against passage of the tax earlier this year, said, "I feel like saying, 'I told you so.' I'm very happy to see the change. It's one of those situations where common sense dictates that there can be only one result."