House and Senate negotiators, already falling behind deadlines set by the Gramm-Rudman-Hollings deficit-reduction law, struggled in marathon bargaining yesterday to compromise on a fiscal 1987 budget before Congress recesses this weekend for the Fourth of July holiday.

They reported slow progress as they met into the night, divided over domestic spending as well as defense and taxes.

Still reportedly under discussion in the closed-door talks was a Senate proposal for a reserve fund to finance additional spending for defense and domestic initiatives if taxes are raised to finance them.

Both the Senate and the House have voted to slash President Reagan's $320 billion defense spending request for next year, with the Senate proposing $301 billion and the House $285 billion. Under the reserve proposal, as originally advanced by the Senate, defense spending would be $293 billion without new taxes, and $299 billion with them.

House bargainers balked at the reserve proposal, contending that major Democratic initiatives for trade-related jobs, health and education programs would be jeopardized if Reagan vetoed any tax-increase measures, as he has vowed to do.

One compromise under consideration yesterday would fuzz any reference to tax increases or specific domestic programs to be left in limbo under the reserve concept.

However, sources indicated the conferees were also in fundamental -- and potentially more serious -- disagreement over such basic issues as Medicare, Medicaid and other broad categories of domestic spending.

"The problem," said Sen. Lawton Chiles (Fla.), ranking Democrat on the Senate Budget Committee, "is money."

"They seem to be moving apart, not together," one source close to the negotiations said last night.

Gramm-Rudman-Hollings requires automatic, across-the-board spending cutbacks if Congress exceeds a $144 billion deficit target for fiscal 1987, based on estimates to be made Aug. 15.

Congress does not return from its Fourth of July recess until the week of July 14, leaving only a month for passage of a budget and accompanying deficit-reduction legislation before the deficit-estimate "snapshot" is taken.

As passed earlier this year, both House and Senate budgets met the $144 billion deficit target but required about $40 billion in spending cuts and tax increases in order to do so.

Moreover, since preliminary action was taken on the budgets, deficit estimates have grown by roughly $10 billion, possibly necessitating additional deficit reductions to stay under the ceiling.

By law, Congress was supposed to have passed the budget and made progress on appropriations and deficit-reduction reconciliation legislation by now.

Without such action, the Gramm-Rudman-Hollings law said Congress could not recess for the Fourth of July holiday.

However, the House quietly waived the provision last week, and both houses plan to recess today or Friday, with or without a budget.