Mayor Marion Barry and members of the D.C. Lottery Board, after months of wrangling over the city's new legal gambling operations, have reached a fragile truce.

Barry and City Council member Nadine P. Winter (D-Ward 6), a close ally of the mayor's and a key player in the lottery board controversy, last week orchestrated a compromise to provide the cash-strapped Lottery Board with an additional $1 million in operating funds this year--about $500,000 less than the board originally requested.

In return, the board pledged to be more responsive to outside suggestions on operating the lottery more efficiently, and also agreed to lay off one-fourth of its 87-member staff to reduce overall costs.

But even with last week's budgetary compromise, the five-member, quasi-independent board still faces far tougher decisions that will test its mettle and offer clues to whether it has the strength and political acumen to withstand further attempts by Barry to exert greater control over the board, especially in the granting of lucrative gambling contracts.

"The budget dispute is a smoke screen" for Barry's continuing concern about the board's granting of contracts, said one City Council member who asked not to be identified.

The mayor contends he has been justified in pressuring the board because at times it has been divisive, undependable and prone to overlook the niceties of the District's contract law.

City officials are keenly concerned about the future of the new agency because of its long-term financial importance to the District. This year alone, with a budget that won't exceed $2.1 million, the lottery board's operations are expected to net a vitally needed $21 million in revenues for the city.

So far, the political controversy has not noticeably affected lottery ticket sales. But officials are worried that Congress--which controls the city's purse strings and was not enthusiastic about allowing gambling in Washington--may inject itself into the controversy if it drags on too long.

In seeking an accomodation with Winter, the board last week agreed to cut costs and lay off 22 low-level and mid-level employes. But the board, which has had management problems, has not attempted to get rid of any high-priced staffers, some of whom are thought to do little work.

"They're getting rid of all the secretaries who do all the work, while the fat continues to float at the top," complained one high-paid lottery official.

Also, the board is paying out about $28,0000 a year in rental for temporary offices on New York Avenue that officials say are unsuitable. Barry prevented the board from renting new offices on 14th Street NW that are more secure and less expensive. The mayor is insisting that the new agency move to a site in Anacostia, but the building won't be ready for months or perhaps a year.

While these and other budget problems are nettlesome, they pale in comparison to the legal and political problems the board faces in awarding contracts for the continued operation of the city's instant-winner lottery game and to finally begin a long-delayed daily numbers game.

The board, acting on advice from Corporation Counsel Judith Rogers, last week canceled its plans to negotiate a new contract with Games Production, the firm that now runs the instant game.

The legal advice, received a day after the board had voted to negotiate with Games Production, allowed time for a second firm, Raven Systems, to qualify to bid on the contract by rushing through an application for minority certification from the city's Minority Business Opportunity Commission--a prerequisite for getting the contract.

The projected $100 million-a-year daily numbers game, in which bettors play three-digit combinations similar to the legal game in Maryland, had been scheduled to begin next month. But challenges by the Barry administration and in the courts have caused a delay expected to cost the city at least $7 million in potential revenue. The board is scheduled to try again Friday to select a contract winner.

Sources say Barry may insist that the board postpone further consideration of new contracts until he has replaced two uncooperative board members, Lillian Wiggins and Jerry Cooper, whose terms expire at the end of the month.

Several City Council members, including Winter and Chairman David A. Clarke, a friend of Cooper's, have indicated a reluctance to change the makeup of the board until major decisions about the contracts are made. Winter and Clarke planned to send a letter to Barry on Friday urging him to delay submitting new nominations.

Despite Barry's concern, Joyce Blalock, the District's inspector general, said last week that her office has routinely monitored the Lottery Board since last summer and that she has found "no serious management deficiencies."

Board members concede that they've made mistakes but say they are no worse than mistakes made by other new agencies getting started. The board's first executive director, Douglass W. Gordon, was demoted this year after continuing personnel problems. Gordon's replacement, Chester C. Carter, has been ill and is not expected to return to work soon.

Board member Wiggins, one of the most outspoken lottery officials, said there is no justification for the criticisms that have been heaped on the board by the mayor.

Said Wiggins: "The lottery is a baby--and you need more time to raise the baby."