Mayor Marion Barry announced his support yesterday for raising the drinking age in the District to 21, a major boost to efforts to get the city to conform to the higher drinking-age standards of surrounding jurisdictions.

Members of Congress and officials in Maryland and Virginia have been pushing the District for years to raise the drinking age, arguing that the city is becoming a magnet for young drinkers who may then drive home drunk. The city's drinking age is 18 for beer and wine and 21 for liquor.

The D.C. Council, which last year killed in committee a proposal to raise the drinking age, must approve any change. A recent count of the council showed three members supporting the change and 10 opposed, according to an administration official. However, some members said the mayor's backing for the change, adding visibility to an emotional issue in an election year, could make a difference.

"As good neighbors, it is important that we not provide a haven for those young people who would use the District to obtain alcoholic beverages prohibited in the communities in which they live," Barry said in a statement. Because current law permits 18-year-olds to purchase alcohol, individuals as young as 14 can get alcohol illegally through their older friends and raising the drinking age would make this less likely, he said.

Under federal law, the District stands to lose about $7.8 million in federal highway funds over the next two fiscal years if the city does not conform to the higher drinking-age standard, but Barry did not cite this as a reason for his new policy.

D.C. Council member John Ray (D-At Large), who strongly opposes raising the drinking age, had said earlier that the mayor's backing for the higher drinking age could influence some members and might lead the council to approve the change.

"The entire issue of raising the drinking age is a political issue," Ray, chairman of the Committee on Consumer and Regulatory Affairs, added yesterday. "I can't believe anyone would believe that raising the drinking age would stop young people from drinking or from driving after they have been drinking."

Council Chairman David A. Clarke sent a letter to the mayor yesterday assuring him that, once submitted, his proposal would get a vote in Ray's committee, a council staff aide said.

The Washington D.C. Restaurant and Beverage Association, a group representing about 600 restaurants and bars in the city, opposes the 21-year-old drinking age, disputing the argument of many backers that it would mean fewer traffic deaths. A 1983 survey on the issue indicated that perhaps 13 percent of the bars and restaurants in the city might have to close, according to Michael Maher, the group's executive director.

But in Georgetown, where residents have complained bitterly about rowdiness around bars that cater to teen-agers, 85 percent of the bar and restaurant owners support the change, according to the Georgetown Business and Professional Association.

While supporting the increase, Barry took pains not to cast blame on 18- to 20-year-olds for drunk driving. He cited police department statistics showing that of those arrested for drunk driving in the District early this year, only 5.8 percent were under 21.

Council member John A. Wilson (D-Ward 2), who represents Georgetown, was the lone supporter of the change in committee last year.

"Mothers and fathers in Virginia and Maryland must clench their teeth every time they may think their kids are getting drunk in the District and going home on the highways," Wilson said.

At-large council member Carol Schwartz, the council's lone Republican and a candidate for mayor, said that philosophically she opposes raising the drinking age, because 18-year-olds are treated as adults for most other purposes. But with the drinking age being raised in most other jurisdictions, she said that practical considerations eventually might lead her to vote for the change.

"Those who can go off to war, can vote, can sign contracts should be able to drink wine and beer . . . but we don't want every 18- to 20-year-old on the East Coast to come into the District to do so," said Schwartz. She said she would prefer that other jurisdictions lower their drinking ages to 18.

Congress approved legislation to cut federal highway funds starting in fiscal 1987 to any states that failed to raise the drinking age to 21. As a result, many states -- including Virginia and Maryland -- conformed. Now 43 states have approved 21 as the minimum drinking age, according to the National Safety Council.

Barry in the past has not taken a strong position on the issue, pointing to the council committee vote as an indication that the higher drinking age could not gain approval.

Of the committee members, Ray and Charlene Drew Jarvis (D-Ward 4) indicated yesterday that they would continue to oppose the higher drinking age. Council members Polly Shackleton (D-Ward 3) and Frank Smith Jr. (D-Ward 1), who also voted against it last year, could not be reached.

Reps. Frank R. Wolf (R-Va.) and Michael D. Barnes (D-Md.), who both have pushed the District to follow their states' action, said yesterday they were pleased with the mayor's decision.