Following reports of five deaths from allergic reactions to the popular prescription painkiller Zomax, its manufacturer, Johnson & Johnson Products Inc., said yesterday that it was "temporarily withdrawing" the drug from the market.

Spokesmen for the company and the Food and Drug Administration said the action was taken voluntarily, and not at the government's urging, until stronger warning labels can be completed for physicians who prescribe the drug.

Johnson & Johnson had been struggling, with surprising success, to regain public confidence in its products since last fall, when it temporarily pulled its over-the-counter Tylenol capsules off the shelves because of product-tampering that killed seven people in the Chicago area. Tylenol capsules were recently reintroduced in tamper-proof packaging.

The effect of the Zomax publicity on the New Brunswick, N.J., company is uncertain, but one government source suggested that yesterday's quick decision to pull the drug off the market temporarily was taken because of "sensitivity over the lingering Tylenol problem."

In a pattern similiar to that used with Tylenol, Johnson & Johnson said, "We request that any consumer having Zomax return the drug to the drugstore." A spokesman said the company will reimburse pharmacists for repurchasing the drug from consumers.

Johnson & Johnson has been meeting with FDA officials to toughen the labeling on Zomax, which has been marketed since October, 1980. Since its introduction, Zomax has been prescribed to more than 15 million patients to relieve moderate to severe pain, the company said. Surveillance of side effects revealed about 1,100 allergic reactions, it added.

"The severity of these reactions has ranged from mild rash to anaphylaxis. This includes five deaths, two in patients known to be sensitive to aspirin," said company spokesman Robert Andrews. Anaphylaxis is a swift, life-threatening physical reaction that occurs when the body's defense system has an allergic overreaction to a substance.

FDA spokesman Christopher Smith said two of the people who died were from Massachusetts, and the other three were from North Dakota, Kansas and New York. He said he did not know their names or ages, but said the first death occurred a "little over a year ago."

Smith emphasized that the adverse effects were "rare. We think the problem can be solved with more adequate labeling to alert physicians about the problem." A spokesman for the Johnson & Johnson subsidiary that makes Zomax said that doctors and pharmacies should receive official notice of the withdrawal by Monday.

Zomax's label was changed earlier to strengthen the allergy warning, and the FDA's Smith said that company officials met as recently as last week to work on an update.

He noted that many other drugs, including penicillin, may produce severe allergic responses, but added that the FDA was concerned about "how widely this drug has been prescribed," for everything from "menstrual cramps to severe headaches."

It is popular, he said, because it offers an alternative to drugs with codeine, such as prescription Tylenol, which have the potential for addiction.

Yesterday's decision to pull Zomax off the market for the time being followed a stock market scramble in which Johnson & Johnson's stock dropped in the early afternoon, when trading in the issue on the New York Stock Exchange was halted temporarily. The stock closed at $48, down $2.25 for the day. In markets elsewhere, it went as low as $45.

The activity apparently came in response to rumors about problems with Zomax after a broadcast Thursday night by a Syracuse, N.Y., television station about the five deaths.

Zomax is produced by McNeil Pharmaceutical, a Johnson & Johnson subsidiary in Spring House, Pa.

Tylenol is produced by another subsidiary, McNeil Consumer Products, in Fort Washington, Pa.