It took six and a half hours of nose-to-nose negotiation, but Congress' two top tax writers managed to craft a $9 billion tax-increase bill late Thursday that will encounter little opposition, congressional and business officials said yesterday.

"I think they skated through the mine fields pretty well," said Nick Calio of the National Association of Wholesale Distributors. "You have some cases of heartburn, but nobody's got a cardiac infarction."

House and Senate conferees voted to support the legislation in late-night meetings Thursday following the closed-door session between House Ways and Means Committee Chairman Dan Rostenkowski (D-Ill.) and Senate Finance Committee Chairman Lloyd Bentsen (D-Tex.). It still must be approved by the House and Senate as part of a $24 billion deficit-reduction package before Congress leaves for its Christmas holiday.

The final compromise dropped a number of the most controversial provisions of the House bill. It jettisoned, for instance, a plan to end the deduction for more than $5 million in interest on money borrowed to acquire another company.

That provision and others relating to mergers and takeovers had been sharply criticized on Wall Street as providing the spark that touched off the Oct. 19 stock collapse.

The Dow Jones industrial average rose 50 points yesterday and the market has been erratically rising this week, but the Dow remained about 170 points below its pre-Black Monday level.

The takeover proposals were the target of heavy lobbying by Wall Street brokerage firms and corporations with ongoing deals. Another dropped provision of the House bill, to reduce writeoffs on such "intangibles" as customer lists, was so fought by newspapers and franchisers that staff aides assumed almost from the beginning that it would not survive.

The chairmen's decision not to include a revision and expansion of the minimum tax on profitable corporations, which had been in the House measure, also eased business opposition to the bill.

"It's not a bad bill at all," said Peggy Duxbury, director of taxation for the National Association of Manufacturers, which had been especially worried about the minimum-tax provision. "It's not perfect, but it's a lot better than it could have been."

The package that emerged from the Bentsen-Rostenkowski summit also softened potential opposition by abandoning a provision that would have taxed profits on bonds that were bought for less than market value, a proposal that was strongly opposed by banks and brokers.

Ways and Means members said the outcome was not a defeat for Rostenkowski, despite the large number of provisions he gave up. They pointed out that a number of items in the House bill were included in the package.

Among them were denial of foreign tax credits on income earned for companies by South African subsidiaries, reduction of incentives for companies to convert to tax-advantaged limited partnerships, and an excise-tax penalty on corporate "raiders."

Rostenkowski got half a loaf on an issue he had staked out early in the conference: He had said that $1.8 billion in revenue from a speed-up in corporate estimated tax payments should not be counted toward reducing the deficit. The final compromise sped the collection up only half as much, but counted the total $900 million to be collected in 1988.

Rostenkowski also shored up support among his committee members by judicious negotiation. Rep. Tom Downey (D-N.Y.) got to keep a special exception that would permit a state takeover of the troubled Long Island Lighting Co. using tax-exempt bonds. Rep. Charles B. Rangel (D-N.Y.) got the South Africa provision. Rep. J.J. Pickle (D-Tex.) was pleased when a new tax on certain income of trade associations was dropped.