Former lieutenant governor Evelyn Gandy fought her way into a runoff tonight in a field of five candidates in Mississippi's democratic gubernatorial primary.

Gandy, 62, will face Attorney General Bill Allain in a runoff Aug. 23. With just over half of 2,070 precincts reporting, Gandy was leading Allain by two percentage points with 38 percent of the vote. Allain's strong early showing was more than matched by Gandy's late returns from rural precincts.

Wealthy businessman-planter Mike Sturdivant trailed with 22 percent. A farmer and a two-term legislator rounded out the field.

"Let's get ready for the runoff," Gandy said in a hotel ballroom full of cheering supporters.

Across town, Allain, whose strong showing surprised political observers, told an ebullient crowd, "We've sent a message to the special interests and utilities: 'Don't mess with Mississippi.' "

Businessman Leon Bramlett ran unopposed in the Republican primary. The general election is Nov. 8.

In this, her second attempt to become the first woman governor in the Deep South not preceded by her husband, Gandy is testing tradition and modern campaign techniques. Four years ago, she led in the Democratic primary but was forced into a runoff against William F. Winter, who defeated her badly--with the help of some macho political ads--and went on to win the governorship.

This time around, Gandy changed her image a bit, firming up her handshake and updating her wardrobe. Her campaign spots touted her 35 years in state government, deflecting opponents' ads raising the gender issue.

Gandy, a former insurance commissioner and state treasurer, began her political ascent as a state representative from Hattiesburg in 1948. In past statewide races, she has drawn more than 200,000 votes, doing well among women, blacks and the working class.

All three Democratic front-runners aimed last-minute radio spots at blacks, who were expected to turn out in large numbers for local races following a statewide voter-registration drive launched by the Rev. Jesse L. Jackson.

"Vote before you see your boss, and if you do, on Wednesday you'll be your own boss," preached Jackson, who claims to have registered 16,000 voters in Mississippi since June.

Blacks now account for 26 percent of the state's voters, said Les McLemore, a Jackson State University professor.

More than 300 federal observers monitored today's voting in eight counties. The observers were dispatched by the Justice Department after blacks complained of voting discrimination to Assistant Attorney General William Bradford Reynolds during his recent visit to the state. Voting-rights lawsuits delayed balloting for board of supervisors candidates in 14 of Mississippi's 82 counties.

With the front-runners in the Democratic gubernatorial race differing little on issues, Allain, 55, pitched himself as a populist, attacking big business and utilities. Sturdivant, 55, vowed to bring prosperity to the nation's poorest state.

A controversy over advertising lifted the race above boredom. Sturdivant denounced a flier, stamped with his name, that attacked Gandy for advocating segregation in a 1962 race. Sturdivant, a Delta planter and hotel developer, mass-mailed his disclaimer, with copies of the flier, to blacks.

Last week, other anti-black ads began to cut into Gandy's black support, said aides, citing polls Gandy, who was an aide to the late senator Theodore G. Bilbo, a symbol of segregation, countered with ads attacking Sturdivant as a "fourth-generation planter who made $2 million last year" and sent his children to private schools.