Maryland Attorney General Stephen H. Sachs, battling to gain ground on rival William D. Schaefer for the Democratic gubernatorial nomination, drew more than 2,000 persons to a Baltimore fund raiser today and collected more than $200,000 to finance his underdog campaign against the Baltimore mayor.

Buoyed by the turnout, Sachs predicted that his campaign, which trails the mayor by more than 2 to 1 in the latest polls, would engineer "the greatest political upset in Maryland political history" in the Sept. 9 primary.

Key Sachs supporters, however, acknowledged that their campaign is facing an uphill fight before it is able to match the popular Baltimore mayor's ability to corral dollars and votes.

"If we did five of these in a row, we could match the mayor," said Joel Rozner, one of three Prince George's County Sachs organizers, comparing today's affair with Schaefer's $1 million, one-night fund raiser in the fall.

The gaggle of politicians and other Democratic candidates who showed up here today were a reflection of this watershed political year in Maryland politics; among them were three who seek to replace Sachs as attorney general and several who are running for the U.S. House and Senate.

Sachs, who is attempting to ignite a traditionally Democratic coalition of labor, minorities and women in his campaign against the mayor, called attention to the heterogeneous crowd today between licks from a rhythm-and-blues band whose members are Baltimore transit workers.

"You are white, you are black, you are Asian, you are Hispanic, you are young, you are old," he told the crowd at a Baltimore County catering hall. "We are one family, we need each other and have a stake in each other's destiny."

In counting on heavy black support in Baltimore and Prince George's County, Sachs is hoping to follow a pattern established in 1982 and 1984 in the electoral triumphs of Baltimore State's Attorney Kurt Schmoke and presidential candidate Jesse Jackson.

Schmoke, expected to run for mayor in this city in 1987, abandoned any semblance of neutrality today, declaring, "Maybe the state's attorney doesn't [endorse], but a potential candidate for mayor has to think about who he would like to see as governor."

Sachs, who is struggling to engage Schaefer in a debate to highlight the differences between them, said today, "The mayor of Baltimore City believes the way to win elections is to avoid issues, to avoid discussion, to avoid debate . . . .Trying to find Mayor Schaefer on the issues is like trying to find Herb in a Burger King."