The Reagan administration is locked in a lobbying war with the National Association of Realtors to try to rescue its proposal to use federal money to finance local efforts to fight housing discrimination.

But the administration's oft-criticized record on civil rights may be more important in determining the outcome of the battle than the Realtors' influence.

The battle is centered in the House Banking subcommittee on housing and pits two forces for which many panel members, particularly Democrats, feel little affection.

Housing and Urban Development Secretary Samuel R. Pierce Jr., leading the administration's effort, has gone toe to toe with members of the subcommittee over the years, having several shouting matches at hearings. Relations between the panel and the department remain strained at best, a situation that has not helped Pierce's cause.

The NAR, on the other hand, through its political action committee, distributed $2.5 million in the 1984 federal elections and is known for its hard-nosed lobbying that often inspires fear but not love.

At issue is federal sponsorship of "testing," in which people with similar characteristics -- except for race or ethnic background -- seek to rent or buy housing. If the minority person is told the unit is not available and the white person is told it is, this can be used to prove that the landlord, seller or broker is guilty of discrimination.

The fiscal 1986 housing authorization bill, scheduled for consideration today by the housing subcommittee, includes an administration-backed provision that would allow HUD to make grants to help community groups do testing. Under the bill, HUD could offer up to $4 million in grants next year.

Pierce calls testing "a very important tool" in fair-housing enforcement, and the proposal might be expected to have wide support in the heavily liberal housing subcommittee. The panel's chairman, Henry B. Gonzalez (D-Tex.), introduced the proposal and included it in his bill, HR 1, which is designed to represent a consensus of the subcommittee's Democratic majority.

But a subcommittee source said yesterday he expects that an amendment by Rep. Gerald D. Kleczka (D-Wis.) to delete the testing money will "pass handily." He said, "Pierce hasn't got much support among the Republicans, and the Democrats are highly suspicious of" the administration's motives. "An administration that is rewarding William Bradford Reynolds," assistant attorney general in charge of the Civil Rights Division, by nominating him to the Justice Department's No. 3 job lacks credibility on civil rights, he said.

In addition, he said, some Democrats have "questions about where these testers will go" and fear that they will go into "marginal Democratic districts while nothing is done in white Republican suburbs."

The NAR, for its part, supports the Kleczka amendment and is doing its best to see that it is approved. Kleczka's office said, however, that his opposition to government involvement in testing stems from his experiences as a Wisconsin state legislator and that he had decided to offer his amendment 10 days before the NAR called.

Pierce, in an interview, made no bones about what he sees as the NAR's effectiveness nor about his view that campaign contributions underlie that effectiveness.

He said he had been calling individual members to try "to counter this" and that "it's interesting some of the answers you get back.

"I got a very honest answer from one congressman who told me that frankly he needs the money . . . . They do give money to people running for office, and he said that in his particular situation he needed money . . . and he figured he owed them a vote . . . . He said, 'I have to go with them.' Not that he cared so much about testing one way or another, I guess.

"He was the only one who was that direct with me," Pierce said. "Others said, well, that they thought maybe it was something that would cause a lot trouble . . . or it needed regulations, let's get the regulations and then let's see where we go -- and that's a stall tactic."

Pierce said he is pressing the issue because he feels strongly that while most overt forms of racial discrimination have faded, housing bias continues in subtle and hard-to-prove forms.

He noted that the Supreme Court has made testing much easier to use and said the knowledge that it is going on in a community "will make landlords and sellers straight, and that's what we want them to be, straight."

The NAR's chief lobbyist, Albert E. Abrahams, expressed concern that the grants to private groups envisioned by the bill would be confusing because there would be no uniform standards that Realtors, sellers and landlords could be sure they were meeting.

He said the NAR might support a testing program if it included national regulations and if the Realtor group were able to "work with" HUD in formulating them.

Pierce said NAR complaints are unfounded because HUD would supervise and counsel local groups to ensure fairness and because courts would always be available as ultimate arbiter of such questions.

He charged that the NAR's desire for formal regulations is a delaying tactic and that regulations could be attacked in court, thus paralyzing the program, at least temporarily.