The opposition Fianna Fail party of former prime minister Charles Haughey appeared early today to have the best chance of forming a new government in Ireland following the country's second extremely close national election in eight months.

Fianna Fail, which offered voters a less painful alternative to the tax increases proposed by Prime Minister Garret FitzGerald, has held a narrow lead over his coalition of Fine Gael and Labor parties throughout the slow count of Thursday's vote. Final results are not expected before tonight.

Political leaders and Irish television computer projections early today forecast that Fianna Fail would increase its share of the 166 seats in the Irish Parliament from 78 to at least 81, while FitzGerald's coalition would decrease in size from 80 to 78 seats. This would again leave the balance of power with a handful of independent and minor party members of the Dail, or parliament.

With all but a dozen parliamentary seats filled early this morning in Ireland's complicated system of proportional representation, 76 seats had been won by Fianna Fail with 47 percent of the total vote, 59 seats by Fine Gael with 38 percent, and 13 seats by Labor with 9 percent.

Six seats were won by independents and the small, radically socialist Sinn Fein the Workers' Party, which appeared to benefit from a protest vote in working-class, inner-city areas against high unemployment, urban housing shortages and the relatively austere economic proposals of all three major parties.

"It's quite clear that I will be forming the next government," said Haughey, who was prime minister from late 1979 until last June. Indicating that he expected to pick up parliamentary support from some of the independents, Haughey said, "I'm very pleased although it offers a real challenge, with some problems to be tackled."

FitzGerald, who remains prime minister until the new Dail meets March 9, refused to concede defeat. He held out hope that he could regain the support of independents who had deserted him in the confidence vote on his proposed budget.

"It is remarkable the way our votes held up," FitzGerald said of Fine Gael's 1 percentage point gain in its share of popular support, "after we had to go to the country with a very tough budget."

The election campaign focused on the voters' perception of FitzGerald and Haughey and their approaches to the problems of big budget deficits, a large foreign debt and high inflation and unemployment.

FitzGerald's budget proposals to cut the deficit and foreign borrowing included unpopular taxes on children's clothing and shoes and a reduction in milk and butter subsidies that would have raised milk prices by a third.

Fianna Fail offered an alternative budget that would replace these items with increased taxes on banks and insurance companies and accelerated the government's collection of other business taxes. Economists criticized the accelerated tax payments as a gimmick that would only postpone the government's revenue problem.

The polls showed that FitzGerald was much more popular than Haughey with the voters, being credited by them with more integrity and ability as prime minister. Political analysts said FitzGerald was successful on capitalizing on his personal support during the campaign to offset the unpopularity of his budget proposals and help persuade voters that austerity measures must be pursued by whoever forms the next government.

Fianna Fail seemed to benefit most by a poor showing by nine militant Irish nationalist parliamentary candidates who campaigned primarily against British rule in neighboring Northern Ireland. They included Bernadette Devlin McAliskey, a former member of the British Parliament representing the People's Democracy Republican group that campaigned for civil rights for the Catholic Irish nationalist minority in Northern Ireland a decade ago, and eight candidates put up by the Provisional Sinn Fein, the political arm of the paramilitary Provisional Irish Republican Army that has carried on a terrorist campaign against British rule in Northern Ireland.

Only McAliskey was able to hold more than half the votes that had been won in June's election in the same constituencies by nine Irish nationalist terrorists in Northern Ireland, four of whom were then on hunger strike in the Maze Prison outside Belfast.