Output at the nation's factories, mines and utilities rose a healthy 0.5 percent in May, the government reported yesterday.

It was the biggest increase in three months and provided further evidence that American manufacturers are beginning to benefit from a lower trade deficit, analysts said.

The Federal Reserve said the May advance followed a revised 0.1 percent decline in industrial output in April.

However, the April performance had originally been put at a much weaker 0.4 percent decline, which would have been the biggest drop in a year. In addition to revising April up, the new report revised the February and March figures upward.

Analysts said the May increase and the upward revisions were signs that the decline in the value of the dollar over the past two years is finally beginning to pay off in increased sales abroad by U.S. manufacturers.

Analysts said the production improvement is even greater when the effects of higher import prices caused by the weaker dollar are removed. In volume terms, imports have been falling since mid-1986, economists said.

"This improvement is coming at a welcome time. Increased jobs in the industrial sector are necessary if we are going to maintain a consistent pace of consumer spending to keep the economy from tipping over into a recession," said Lyle Gramley, chief economist of the Mortgage Bankers Association.

In May, activity at manufacturing plants rose by 0.5 percent following a decline of 0.2 percent in April.

The increase included a 0.5 percent rise in output at plants making durable goods -- items expected to last three or more years -- and a 0.6 percent increase at factories making nondurable items.

The manufacturing increase came despite the fact that output at auto factories fell 1 percent as auto makers continued to idle assembly lines and lay off workers in the face of sluggish sales. Autos were assembled at an annual rate of 7.1 million units, but even this reduced level of production exceeded the level of sales in May.

Jill Thompson, senior economist at Data Resources Inc., predicted that auto sales will continue to decline for the rest of the year and said this would be a continuing drag on the overall production figures.

After little change in March and April, output of defense equipment increased 0.5 percent in May, pushing activity in that category 5.3 percent higher than a year ago.

The mining industry, which includes oil and gas well drilling, suffered a 0.2 percent drop in production in May, which put activity 3.5 percent lower than the already-depressed level of a year ago. This sector has been under severe strain because of the big slide in oil prices last year.

Utilities saw output rise a sharp 1.4 percent to stand 3.1 percent higher than a year ago.

The various changes left industrial production at 127.8 percent of its 1977 base of 100, 2.9 percent higher than a year ago.