Defense Department officials said yesterday that they would have to ask Congress for a 5.2 percent increase over inflation in next year's budget to get back on the track President Reagan has laid down to rearm the nation.

This would mean an increase from the $281.2 billion in spending just approved by Congress for fiscal 1986 to about $296 billion -- plus inflation -- for fiscal 1987, which begins Oct. 1. If inflation were 4 percent, the total would climb to about $308 billion -- a 9.2 percent increase over fiscal 1986.

Defense Secretary Caspar W. Weinberger plans to request a total in that neighborhood, aides said, to achieve 3 percent real growth in fiscal 1987 and to make up for the 2.2 percent real cut that he figures Congress imposed on the Pentagon's fiscal 1986 budget. President Reagan has said Congress owes him a 3 percent real increase in his new military budget.

Although congressional leaders predict that a budget seeking such an increase would be dead on arrival, they say that it makes sense for the Pentagon to ask for a large increase to soften the automatic cuts expected to be triggered by the Gramm-Rudman-Hollings balanced-budget law.

Chairman Mark O. Hatfield (R-Ore.) of the Senate Appropriations Committee told The Post after the Senate finished its fractious handling of the Pentagon's fiscal 1986 budget on Thursday, "If you think this year was crazy, just wait until next year."

Aides said Weinberger feels he scored well in his fight for strategic programs this year, notably Reagan's Strategic Defense Initiative, or "Star Wars" missile defense, but lost heavily in his attempts to protect other research accounts designed to keep U.S. forces ahead of the Soviets in weapons quality.

After much back and forth between the House and Senate, this is how the Pentagon fared in the continuing resolution approved Thursday:

*Money: The Pentagon did better than many of its leaders feared it would, partly because the House had called for a budget freeze with no allowance for inflation. The final total of $281.2 billion is $1.5 billion less than the Senate first approved, $12.3 billion more than the original House appropriation and $22.7 billion below what Reagan sought. Including money for nuclear warheads and military construction, the national defense account comes to $297.6 billion. This compares with the Senate target of $302 billion and House goal of $292 billion set forth in their respective budget resolutions. Congress also made $6.3 billion in unspent funds from previous years available to the defense secretary. But it restricted this fund in response to objections that the Pentagon would use it to offset cuts made under Gramm-Rudman-Hollings.

*Antisatellite testing: The Pentagon lost big as the House prevailed in declaring a testing moratorium as long as the Soviets continue to desist.

*Star Wars: The Pentagon won the fight for funding, getting $2.75 billion after several attempts to trim the total to $2.1 billion were defeated. Reagan's original request was $3.9 billion.

The appropriations measure says money cannot be earmarked for any foreign firm "in order to meet a specific quota or allocation to any allied nation." However, the provision gives the Pentagon an opening by declaring that allied nations should be "encouraged" to compete for SDI work "and be awarded contracts on the basis of technical merit."

*Chemical weapons: Congress cleared the way to gear up for the first production of nerve gas since 1969, appropriating $126 million. Production can start in fiscal 1987, but final assembly of chemical weapons cannot be done until Oct. 1, 1987. By then, the Pentagon would have to have a plan for storing in separate states the two types of chemicals that are mixed together to generate nerve gas.

*Procurement reform: Almost all of the House-passed changes were deleted from the final appropriations measure.