Stephen L. Moloney, an Internal Revenue Service auditor, was elected Fairfax City treasurer yesterday, beating four other candidates in the largest field ever to seek the position.

Moloney, 33, a certified public accountant who said he would resign his IRS job to take the $30,000-a-year treasurer's position, won his first campaign for public office with 1,951 votes, according to complete returns. Moloney, like all the other candidates, used an embezzlement scandal involving a former treasurer as the springboard for his campaign.

Current assistant city treasurer G. Thomas Lumpkin, 30, came in second with 1,635 votes, followed by Philip Ferraro, 55, a retired auditor for the federal government with 1,172 votes. The only two candidates with previous political experience, J.L. Reed Jr., 58, an unsuccessful candidate for commissioner of revenue last year, and W. Tilghman (Bill) Scott Jr., 51, a former Fairfax City councilman, trailed with 536 and 425 votes, respectively.

The five candidates ran their campaigns against the backdrop of the conviction in September of former treasurer Frances L. Cox on charges of embezzling city money. Cox held the position for five four-year terms with only token opposition until she was defeated last fall by Ray M. Birch. But Birch quit the job in frustration after serving only three weeks, saying he found the treasurer's office in shambles.

Moloney, who will serve the three remaining years of Birch's term, is faced with implementing new controls mandated by the city council.

In the quieter Manassas Park city treasurer's contest, Ron Smith, 44, a construction company purchasing department employe, defeated Linda Marden, 31, who has been serving as city treasurer since Jerry Davis, who was elected to the job, resigned to become city manager in July. Smith received 421 votes to 370 for Marden and 57 for William Steele.