Mayor Marion Barry went to Walter E. Washington's church in search of votes yesterday, using a biblical theme that was a Washington refrain in the 1978 campaign.

While Barry did not mention the former mayor by name, he told a story that was one of Washington's favorites in the 1978 mayoral race: the tale of the Old Testament figure Nehemiah, who rebuilt the walls of Jerusalem in 52 days despite naysayers who told him to come down.

"It's tough being mayor, you know that," Barry told a sparse congregation of about 100 people at Third Baptist Church at Fifth and Q streets NW, a church founded by the late Rev. George O. Bullock, the former mayor's father-in-law.

"But I'm like Nehemiah. You know the story of Nehemiah," Barry said. "He said he was going to build a wall in less than 55 days. His enemies told him he can't do it. His friends mocked him and asked him what he was doing. They told him to come down. But he said he would not come down because he still had work to do.

"I say the same thing to you on this Labor Day weekend," Barry continued. "I'm not coming down, because there's still work to do."

Barry's appearance at Third Baptist yesterday was only part of a political Sunday in Washington yesterday that featured most of the major Democratic contenders for top office in the Sept. 14 primary.

The politics of the day were confusing, however, as some of the ministers who have endorsed Barry -- giving him the announced support of more ministers than any other candidate -- opened their pulpits and their fellowship hours to Barry's opponents.

Some parishioners didn't take well to the influx of political activity. Even as Barry spoke from the pulpit at Third Baptist, ushers and parishioners at the back of the church mumbled about the Rev. Henry Miles' allowing Barry to speak for more than 15 minutes.

"It's not that I don't like him," one woman usher who asked that her name not be used told a reporter. "But I don't think it's right for him Miles to bring all this politics in here."

After his appearance at Third Baptist, Barry went to the Church of the Ascension and St. Agnes at 12th Street and Massachusetts Avenue NW, where he addressed a group of about 40 parishioners at a reception after services.

Patricia Roberts Harris, Barry's leading challenger, took her campaign into one of Barry's would-be political sanctuaries, Metropolitan Baptist Church, one of the city's oldest and largest churches, at 12th and R streets NW. The pastor there, the Rev. H. Beecher Hicks Jr., endorsed Barry in a spirited speech five weeks ago when Barry announced he had won the endorsement of about 100 ministers.

Harris used a three-minute speech before the nearly 600 people present to accuse Barry of failing the city morally by not decreasing Washington's high rate of infant mortality.

Harris also spoke scornfully of "13-year-old girls selling their bodies just a few blocks from here" while Barry "herded them like cattle" from one corner to another without solving the problem. Christians and a caring mayor, she said to warm applause, "cannot abandon them." Earlier, Harris had visited Springfield Baptist Church at Sixth and P streets NW where she delivered a similar message.

The two other candidates in the Democratic primary, City Council members Charlene Drew Jarvis and John Ray, also spent the day at church. Jarvis went to two churches whose leaders have endorsed Barry--Apostle Smallwood E. Williams' Bible Way Church and Bishop Walter McCollough's United House of Prayer.

Jarvis did not attend the service at the House of Prayer, but instead greeted parishioners in the cafeteria, eating salmon, rolls and coffee.

Ray went to Shiloh Baptist Church, where he and former City Council chairman Sterling Tucker, who was also in the audience and is running to regain his old job, were allowed to stand, but not speak.

After the church service, Ray, the major political supporter of the mandatory minimum sentencing initiative on the primary ballot, criticized as "inaccurate and biased" an editorial on the issue in yesterday's editions of The Washington Post.

The measure would require mandatory jail terms for some persons convicted of using a gun in the commission of a violent crime and those convicted of trafficking in narcotics.

"I doubt that the writers of this editorial have ever been to Lorton Reformatory to learn something about the people there and why they got mixed up with drugs or guns," Ray said. "They form their opinions and peddle them to the readers in total isolation from the reality of urban life."