Congressional legislation that is vital to Mayor Marion Barry's financial rescue program for the District of Columbia government and his own political standing is showing signs of life after being bottled up for months in committee while the fiscal squeeze on the city tightened.

Prospects appear to be improving for two key measures that would give the city more federal aid next year and the power to sell bonds to pay off its deficit. Approval of both is essential to Barry if he is to get through the 1982 mayoral primary without substantial tax increases for city residents or additional worker layoffs.

A bill to increase the maximum annual federal payment in lieu of taxes from $300 million to $336 million is likely to be approved in the House next week, congressional sources said. The bill has the endorsement of the Reagan administration, and Sen. Alfonse D'Amato (R-N.Y.), chairman of the Senate D.C. Appropriations subcommittee, said he is confident of Senate approval once the measure clears the House.

Barry is counting on that money to cover wage increases now being won by city workers in salary negotiations and to fulfill the District government's obligation to put money into city workers' pension funds.

Barry's budget for the 1982 fiscal year, which begins Oct. 1, assumes that the federal payment will be only $300 million, but it also contains only enough funds for salary increases of about 2 percent. He has already sent to the City Council a resolution declaring that part of the additional $36 million would be used to cover what will certainly be a larger overall wage increase.

Enactment of the bond authorization measure is much less certain, but its chances for approval improved significantly when a key Republican congressman who had vigorously opposed the measure said he had decided not to block it. Rep. Stewart McKinney (R-Conn.), ranking minority member of the House District Committee, stopped far short of endorsing the measure. But his decision not to work actively against it improved the changes that Committee Chairman Ronald V. DELLUMS (C-Calif.) and D.C. Del. Walter Fauntroy could shepherd it through to passage in the House.

The bill would authorize the District to issue up to $184 million in bonds to pay off cash debts incurred before the current fiscal year, or to reimburse the city treasury for old bills that have been paid out of current revenues. The District is obliged to clear up that deficit in order to enter the commercial borrowing markets, as envisioned in the home rule charter. Barry and his financial advisers concluded that the bond-issue route was the only way to raise enough cash to pay off the deficit without laying off so many workers that services would be crippled, or raising taxes to a point where they would stifle economic growth.

But McKinney opposed the measure, saying that the bonds would have to be sold at such high interest rates that the next generation of District residents would have to be heavily taxed to meet the payments. He said instead that the city should raise cash through the sale of surplus real estate, such as the downtown campus of the University of the District of Columbia, which he said will never be built.

McKinney said through a spokesman that, after consulting the U.S. Treasury Department, he had concluded that the proposed bond sale "will force discipline on the city and will impose higher standards" of financial management. He said he is "still against forcing city residents of tomorrow to pay for the excesses of today," but would "not interpose" himself against the bill.

Withdrawal of McKinney's opposition is a boost for the bond legislation. But the measure still is far from enactment, since no committee action has been scheduled in either the House or the Senate. Barry's top financial aides now acknowledge that there is no hope of obtaining any of the funds in the current fiscal year, as they originally said they had to do to keep the city solvent this summer.

City Administrator Elijah B. Rogers and Philip M. Dearborn, financial counselor to the mayor, said they are still studying plans for raising enough cash to meet payrolls and for disbursement of welfare and pension checks for the rest of the current fiscal year. They are scheduled to report to the City Council on their proposals next week.