Cardinal John O'Connor, Mayor Edward Koch and several hundred other pilgrims head off this week on a peace mission to Ireland, hoping prayer can succeed where 800 years of violence have failed.

"I think (prayer) is an area that's been totally neglected as a possible key to peace with justice, and I think maybe our doing this will catch on," O'Connor said last week. "I believe in the tremendous power of prayer."That power will be tested mightily in Northern Ireland, where more than 2,600 people have been killed in the two decades since the Irish Republican Army revived its war against British rule.

This is a land where even a pilgrimage for peace and justice can accentuate divisions - if peace means the status quo, the IRA would rather fight; if justice means change, many Protestants would also fight.

O'Connor called for the pilgrimage on St. Patrick's Day after a Protestant gunman killed three mourners and wounded 68 others at the Belfast funeral of three IRA members.

The idea came to him, the cardinal said, as he was speaking from the altar of St. Patrick's Cathedral. In an emotional sermon, O'Connor bemoaned the lack of concern for Northern Ireland's troubles by Americans, 40 million of whom trace their roots to the island.

"Have we forgotten the very existence of Ireland, and the horrors that have been perpetrated there for so many years?" he asked.

The cardinal said he hoped 100,000 pilgrims would follow him. But, possibly because people already had made their summer vacation plans, or because they are bewildered and frustrated by Ulster's seemingly intractable problems, fewer than 1,000 signed up.

They include City Council President Peter Vallone, former Gov. Hugh Carey and Steven McDonald, a New York City policeman who was paralyzed when he was shot in the line of duty two years ago.

They depart Thursday and arrive the next day in Knock, a town in the west of the Irish Republic where Catholics believe Mary, mother of Jesus, appeared in 1879.

After three days of Masses and other services at the shrine there, the group will spend several days in Dublin, with a side trip across the border into Northern Ireland. O'Connor will say Mass in Armagh with Cardinal Tomas O Fiaich, after a brief visit on his own to Belfast.

Since becoming archbishop of New York in 1984, O'Connor has emerged as the U.S. church's leading spokesman on Northern Ireland - and one of the few American bishops ever to show much interest in its troubles.

The American Catholic hierarchy is dominated by Irish-Americans. But other issues, such as arms control, and other places, such as Central America, invariably get the attention.

"Where are the social activists, especially our priests and nuns, who condemn oppression in the Third World, but are silent about suffering in Ireland?" O'Connor demanded on St. Patrick's Day.

Although the cardinal has consistently denounced violence, he also has criticized British tactics and policies. He visited Joe Doherty, an IRA member accused of murder, in jail in New York; he publicly embraced Peter King, an IRA supporter who was elected grand marshal of the 1985 St. Patrick's Parade.

"With his lips he condemns terror," editorialized the Daily Mail of London. "With his hand he slaps it on the back."

But his defenders say O'Connor treats IRA members much as he does Catholics who disobey church teaching on birth control or abortion: he condemns the sin, but not the sinner.

O'Connor's tenure in New York has been marked by almost as much controversy as Koch's, and some observers are worried the pair will exacerbate tensions in a land where almost anything anybody says offends somebody.

Koch says the pilgrimage is so important he will skip the Democratic National Convention. But the mayor, whose strident rhetoric upstaged the candidates themselves in New York's Democratic primary, is regarded warily by the British, the IRA and Protestant para-military groups - all of whom he has criticized.