Mayor Marion Barry and freshman Sen. Alfonse D'Amato (R-N.Y.) toasted each other with New York state champagne yesterday as city officials had their first working session with the Senate's new overseer of D.C. finances.

Both men came away smiling and pledging cooperation. D'Amato, new chairman of the Senate D.C. Appropriations subcommittee, told reporters afterward that he wants to help solve the city's "very real problems" and does not intend to scrutinize the District's budget line by line.

"I think the vibrations are good," Barry said. "I'm convinced he understands cities, their deficits and their revenue problems." As he and D'Amato were sipping their champagne, Barry raised his glass to the light and joked, "This wine has some money in the bottom of it."

Meanwhile, a late-blooming transition unit headed by attorney Ben Cotten, general counsel for the Republican National Committee, began studying District issues for the newly installed Reagan administration.

Cotten also offered encouraging words of cooperation and optimism to city officials worried about the incoming administration. "What they need is assistance in solving their problems, rather than a lot of people coming in and saying what's wrong," Cotten said in a telephone interview.

It added up to a hopeful day for local officials whose actions remain subject to review by the White House and Capitol Hill and not only generally supported Jimmy Carter, but also knew very few of the players in the new White House team.

Both D'Amato and Cotten were careful not to take firm positions on specific issues, instead confining their remarks to generalities.

Barry arrived precisely on time for his 40-minute talk with D'Amato in the new senator's jumbled offices in the Russell Senate Office Building, bringing along City Administrator Elijah B. Rogers, budget director Gladys Mack and intergovernmental relations chief Barbara Washington.

D'Amato told reporters he was open to the idea of setting a fixed formula for Congress' annual federal payment to the city in lieu of taxes on tax exempt federal land. "We have to work out a system so the [city] administration can predict with accuracy how much revenue they will receive," he said.

He said he would be interested only in the overall financial condition of the city and its accounting system, and not in a line-by-line review of city expenditures. But the question of full budgetary autonomy for the District, D'Amato said, is one for the entire Congress.

The senator said he had not studied Barry's complex borrowing plan for financing the city's budget deficit, but added, "You can't run a city trying to pay off 200-some million dollars. Something will have to be done."

D'Amato's manner was a far cry from the stridency he showed last year in battling fiercely to win his Senate seat.

He promised to visit Barry at the District Building within the next 10 days, and also pledged to work closely with Sen. Patrick J. Leahy (D-Vt.), former chairman of the subcommittee, and his staff.

Cotten said the Reagan transition unit for the District was set up barely a week ago and then had its work interrupted by the inauguration. The unit will make recommendations to the White House, he said, on how to set up an operation for dealing with the District and on specific issues.

He said the team has had a "very pleasant exchange of ideas and thoughts" with city officials, and said its primary focus would be on the city's troubled budget. He said the ream would examine issues such as the city's unique and small tax base, and try to suggest solutions.