STATE legislators in New York and Pennsylvania are starting to tackle the extremely ticklish task of eliminating congressional districts.Redistricting is hard enough to do when the population is increasing. It's even tougher when the population has stayed stagnant or decreased. Many Northeastern states will stand pat or lose a district. New York and Pennsylvania will give up five seats between them. That means a temporary power inversion: United States congressmen will be beholden to state legislators who will decide the fates of their districts. New York faces the nation's biggest decline, losing three of its 34 congressional seats. The battle is just heating up because state legislators have been so involved in New York's gaping budget deficit, says Joseph F. Zimmerman, a political science professor at the State University of New York at Albany. "Obviously, every group wants to protect its turf." Because New York's Legislature is highly partisan, the main focus of the fight will be along party lines. The parties will have to reach some sort of bipartisan compromise, since Democrats hold the Assembly and the governorship, while Republicans hold the Senate. But there are other cross-currents, such as upstate versus New York City, and minorities versus whites. Under the Voting Rights Act, the federal government is supposed to ensure that minorities are not underrepresented. Thus, the four minority US representatives from metropolitan New York - Floyd Flake, Edolphus Towns, Major Owens, and Charles Rangel - are unlikely to lose their districts. State legislators are also loath to fiddle much with the districts of powerful incumbents. Those who are left - junior white representatives - are most vulnerable. The likeliest scenario is that metropolitan New York will lose two congressional seats. One of them could be the district of Rep. Robert Mrazek, a Long Island Democrat expected to run next year for the US Senate. Another challenge: Hispanic voters. They make up one-quarter of the city's population but have only one of the 14 congressional districts representing the city. There is growing pressure to create another congressional district where the majority of voters would be Hispanic. All these calculations are preliminary, since New York City is trying to convince federal authorities that the US Census undercounted its population by up to 500,000 people. If it succeeds, the city might lose only one seat while upstate New York would lose two. The final plan might not win approval until 1992. Many of the same forces are at work in Pennsylvania, which has to cut two congressional districts. When Roll Call, a Washington, D.C., publication, surveyed the Pennsylvania delegation's spending in the last campaign, it found that US congressmen were making efforts to ingratiate themselves with state legislators. In all, the 12 Democratic and 11 Republican incumbents pumped more than $280,000 of their own funds into state races that had a direct bearing on partisan control over redistricting, the survey found. There are other factors. "A lot of our state senators and state representatives would like to look ahead and find themselves running for Congress," says Robert O'Connor, a political science professor at Penn State University. So, they may fight very hard to ensure that their own political base - their state district - is not split between two congressional districts. Unlike New York, where a bipartisan task force is trying to draw up a plan, the drawing of congressional districts proceeds in Pennsylvania like any other law. Some compromise is likely since the Democrats have the governorship and the state House while the GOP holds the majority in the state Senate. Professor O'Connor expects some kind of plan to emerge by year's end.