The Maryland legislature approved the D.C. voting rights amenment today by the narrowest possible margin, pumping new life into a faltering ratification drive that must succeed in 30 more states before the nation's capital can be represented by voting members in Congress.

"Thank God," shouted a jubilant Baltimore delegate and member of the black caucus when the electronic tote board in the House of Delegates finally lit up with the 71 votes required for passage of the measure. It had lost here by one vote on three separate occasions last year.

Voting rights leaders hailed the Maryland action as the boost they need to sell the amendment in other states, where skeptical legislators often have said they saw no reason to approve a measure that could not even get past the District of Columbia's neighbors.

"There's no question the Maryland vote should help us out here," said amendment lobbyist Richard Clark in Sacramento, where the California legislature is considering the measure this week.

Other targets of ratification are Hawaii, where the amendment received a favorable vote in committee last week, Pennsylvania, New York and Rhode Island. Maryland became the eighth state to approve the constitutional amendment to give the District two voting U.S. senators and one voting congressman. For the measure to take effect, 38 states must ratify it by 1985.

That task, amendment supporters still concede, is formidable, if not imposible.

All the difficulties the ratification drive has faced around the country were evident in Maryland, where intense lobbying left the issue in doubt until the final moment. And here, the drive also became caught up in several provincial struggles, including vote trading on other issues and the attempt by two Jewish delegates to force D.C. Del. Walter Fauntroy, the amendment's chief lobbyist, to denounce the Palestine Liberation Organization.

Both this year and last, the amendment breezed through the Senate and a House committee, but ran into trouble when it reached the House floor. There it encountered a solid bloc of Republican, rural and conservative legislators who said they felt that full representation in Congress for the District would result in the election of black, liberal and Democratic senators and congressmen.

On the day before the vote, amendment supporters believed they were still two votes short of the needed majority. In their last-minute lobbying blitz, they called on every resource available, including the office of Vice President Mondale, whose aides placed telephone calls to two wavering delegates, bringing one of them back into the fold.

In the end, however, the battle may bhave been won by Del. Paul Weisengoff, an influential Baltimore Democrat known for his powers of persuasion and his artistry in vote trading. Weisengoff voted for voting rights last year. But in the hallways and chambers, he quietly set about the task of killing the measure. This year, he worked for it.

"Never underestimate the powers of a Weisengoff," said Del. Gerard Devlin, as he noted about an hour before the vote that the supporters had picked up at least four votes they did not have last year.

Still, the floor leader for the amendment, Del. Nathaniel Exum ((D-Prince George's), was so nervous about the outcome as the House convened at 10 a.m. today that he called his colleague Francis Santangelo to come to Annapolis from a sick bed at home in Prince George's County.

At that time Exum still did not know if he could count on the votes of three crucial, undecided delegates from Baltimore -- Anothony DiPietro, Louis Cavallaro and Patrick McDonough.

It was McDonough, who represents a fractious East Baltimore ethnic district, who received the telephone call Tuesday from Mondale's special assistant for domestic policy Jim Dyke.

McDonough, who had voted in favor of the amendment last year, said this week that he was "on the fence" because of a statement made by amendment supporter Fauntroy a few weeks back. Fauntroy had questioned why the FBI in Washington was hiring clerks from Baltimore rather than finding qualified workers in the District.

McDonough viewed that as an "anti-Baltimore" position and said he might vote against the amendment if it would result in the election of pro-D.C. senators and congressmen who were against his own city. But the call yesterday from Mondale's assistant changed his mind.

McDonough came striding through the House chamber after the vote announcing: "I got assurances from the office of Vice President Mondale that they couldn't foresee my fears being realized."

Cavallaro, who had voted against the amendment twice last year, said he had received calls favorable to it from state and city officials and from powerful labor leaders including Dominic Fornaro, who represents the Maryland-D.C. AFL-CIO.

A lobbyist for a coalition supporting the amendment also "spent hours waiting at my office and talking to me over and over again," said Cavallaro. "It was just one more little nail in the plank."

The inscrutable DiPietro kept saying all morning that he had "asked God for guidance on the issue and I'm waiting for his response." Indeed, DiPietro waited until the last second before the House vote was totaled on an electronic board before clicking in his green "yes" vote.

Though DiPietro denied that Weisengoff had any particular influence over him. Exum credited Weisengoff withe "helping us swing" the vote of DiPiettro and several others.

The votes of two Jewish legislators, angered by Fauntroy's visit last year with PLO leader Yasser Arafat, failed to be as crucial as supporters had feared.

Two legislators, Del. Stephen Sklar and David Shapiro, both Democrats from Baltimore, had insisted they would not vote for the amendment unless Fauntroy issued a public statement "disassociating" himself from the PLO's support for the Iranians holding American hostages. Fauntroy refused to issue a statement, branding their request as the "height of arrogance," and both delegates failed to vote for amendment today.

But Exum said that supporters "had written them off" a week ago.

It was just a year ago that Fauntroy, Mayor Marion Barry And Council Chairman Arrington Dixon announced formation of a D.C. Voting Rights Service Corp., a high-budget project operating from a suite of rooms in a new mall on upper Wisconsin Avenue.

As hundreds of dignitaries and other invited guests muched cookies and sipped punch, Fauntroy unveiled a new plan designed to revive the already-sagging ratification effort. Cash and in-kind contributions already totaled $80,000, Fauntroy announced. He later achknowledge that many of those contributions turned out to be unredeemed pledges.

Anothony J. Thompson, a Republican attorney, was introduced as the full-time, $72,000-a-year executive vice president and director of the corporation at the time.

Fauntroy also outlined a three-month campaign that included developing educational materials "with which to educate the American people on the issue" and a "massive effort to involve D.C. residents in a meaningful way." Among the gimmicks planned to promote the drive were a pen pals program, challenge gifts and a "catch them while they are here" plan to enlist volunteers among out-of-towners who visit Washington.

Yesterday, the corporation's suite in the Tenley Mall was vacant, and calls to it were being handled by an answering service in Bethesda.