The House, in an angry mood over the level of allied support for the U.S. military operation in the Persian Gulf, voted overwhelmingly yesterday to begin withdrawing 5,000 American troops a year from Japan unless that country pays the full cost of the U.S. military presence in Japan.

The 370 to 53 vote came during the second day of debate on a $283 billion defense authorization bill that has become the vehicle for a barrage of criticism of Germany and Japan. The annual cost of the 50,000 troops in Japan is $7.4 billion, of which Japan now pays $2.9 billion.

The House action is not final, and it is uncertain whether it will hold up in a conference with the Senate. But it indicated that resentment over the performance of Japan and Germany in the Persian Gulf crisis has spilled into larger military and strategic questions.

In another test of sentiment toward U.S. allies, an effort by Republican forces to tone down a portion of the bill that would hit Germany financially was easily defeated on a vote of 249 to 174. The amendment would have deleted "dual-basing" provisions requiring the Pentagon, starting in 1994, to station U.S. troops with a foreign mission at home unless there was an operational reason to keep them overseas. Troops would conduct exercises abroad but, if adopted, the requirement could cut the number of troops on assignment at any one time in Europe to as few as 50,000.

The defeated amendment also would have restored U.S. funding for a new NATO base in Crotone, Italy.

The bill already reduces by 25 percent the $2.7 billion a year that the United States pays 120,000 foreigners who work at U.S. bases abroad. Of the total, $1.5 billion is spent in Germany.

Rep. Patricia Schroeder (D-Colo.), who has been leading efforts to cut the cost of U.S. overseas troop deployments, expressed shock at "the way the Germans have told us, forget us, we're not doing anything" in the gulf crisis. Later, she added: "We've got 325,000 trooops in West Germany defending against East Germany whose people are all shopping in West Germany at the mall."

Of the 15 Republicans who voted with the Democrats against softening the bill, five are candidates this fall for the Senate, and sources said their votes were an indication of popular support for a tougher policy toward wealthy U.S. allies. The Japan amendment was sponsored by Rep. David E. Bonior (D-Mich.), whose district has been hard-hit by Japanese auto imports. Those who opposed the tough approach noted that Japan pays the largest share of U.S. troops costs of any host country, and more than Germany.

Rep. Stephen J. Solarz (D-N.Y.), a senior member of the Foreign Affairs Committee, warned that the Bonior amendment would be counterproductive and would turn U.S. forces into mercenaries. Several others noted that U.S. forces were in Japan to defend U.S. as well as Japanese interests.

But it was clear that many members relished a chance to vent anger at Japan, whose government has offered $2 billion to help with Operation Desert Shield, the annual cost of which may come to as much as $17 billion. Rep. Don Ritter (R-Pa.) said it was "time to start weaning our allies off the U.S. defense budget."

The Persian Gulf crisis appeared yesterday to have exacerbated tensions that have been festering in Congress for years. "The United States cannot permit its allies to run for the 'peace-dividend window' while the United States continues to pay the bills," said the report of the Armed Services Committee that accompanied the bill.

Another amendment that would have put a 30,000 ceiling on U.S. troops in South Korea was defeated, 265 to 157. The current level is 43,000.