A canny mix of expertise, persistence and pragmatism has brought Sen. Daniel Patrick Moynihan to the brink of achieving his longtime goal of radically reshaping the country's Depression-era welfare system.

But the professorial New York Democrat, a leading thinker on poverty and welfare problems since the 1960s, faces critical tests of personal and political diplomacy in the upcoming battle over what type of welfare bill will go to the White House.The Reagan administration is on one side seeking shorter welfare rolls and ever more stringent work requirements for those that remain; the House is on the other with a five-year, $7 billion plan that would add families to the rolls and reward states that raise cash benefits.

In the middle are Moynihan and his delicately balanced bill, which won a ringing 93-3 endorsement Thursday night on the Senate floor.

The Family Security Act is ambitiously described as a way to turn an outmoded income maintenance system into a jobs, education and training program in tune with today's realities. Yet its cost - $2.8 billion over five years - is relatively modest. To welfare recipients, the bill both offers opportunities and dictates responsibilities; for states, too, it mixes mandates with incentives.

For 18 months Moynihan has pressed the bill gently, academically, with eloquent lectures on the history of the welfare system (a widow's benefit, established in 1935); the status of children today (one in four born into poverty, no other age group is as poor); the coming labor crunch ("we need all our children now, as never before in this century; thus indeed does necessity reinforce compassion").

He's also been relentless in pursuit of his unlikely coalition.

"I do not know how many letters I have (from Moynihan) in my office," Senate Republican Leader Bob Dole, R-Kan., said Thursday before the bill passed.

Referring to his ill-fated presidential bid, Dole added, "Some even came when I was not around, saying, `I know when you come back you will be interested in welfare reform.' . . . There is no question about it. Without his effort, we would not be here today."

There were early signs that Moynihan's quest might bear bipartisan fruit. For instance, an aide to Sen. Thad Cochran, a Mississippi Republican, called early on to ask that the senator be listed as a co-sponsor.

"Has Sen. Cochran read the bill?" responded an astonished Moynihan aide.

"Oh yes," came the reply. "He really wants to be on it."

On the House side, matters took a different turn. Democrats and Republicans emerged from cordial but unsuccessful committee negotiations and said they had unalterable, fundamental, philosophical differences on welfare.

The 230-194 vote, split largely along party lines, reflected the unhappiness of GOP members and the obligation many Democrats felt to side with their leadership. Moderates in both parties pined wistfully for something that looked more like the Moynihan bill.

Rep. Tom Downey, D-N.Y., fell into the job of chief House welfare booster last year after Rep. Harold Ford, D-Tenn., was indicted on tax fraud and other charges and had to relinquish his chairmanship of the House subcommittee that handles welfare.

"It's an accident of fate," Downey said. Of Moynihan, whom he calls a close friend, Downey says, "I studied at his feet."

Downey jokes that he and Moynihan launched private House-Senate negotiations hours after the Senate bill passed - in the Green Room Friday morning at NBC-TV, while Moynihan's makeup for the "Today" show was being applied.

"We started right in," Downey said. "When we're together, we waste no time. We talk about welfare. It's a matter of great interest to both of us."

The House-Senate conference actually will start early this summer. Downey is promising a "hotly fought" battle over whether states should receive extra money for raising their benefits, as called for in his bill. He's also planning to try to up the Senate ante on money for state jobs programs and keep the House bill's mandatory year-round benefits to poor two-parent families - as opposed to the six-month-a-year minimum approved by the Senate.

Nevertheless, Downey insists, "There are not deep ideological fissures here that can't be overcome . . . We all believe that it's work, training and education that will make the difference to welfare recipients."

The White House is the wild card in the welfare equation. Senators complained repeatedly during a week of negotiations before they passed their bill that they were confused about what the administration wanted.

"It's sometimes as if we're talking about another piece of legislation entirely, in another time period," Moynihan mused at one point.

The mixed signals continued after the vote, with White House spokesman Marlin Fitzwater saying the administration had not decided yet whether the Senate bill was acceptable - and who knew what might happen to it in conference with the House.

Moynihan, besieged after the Senate vote by questions about problematic House demands and possible White House vetoes, answered the queries with one of his own: "Can't I just savor 93-3 for a night?"