Sony Corp. of America will raise prices on its entire line of consumer, industrial and professional electronics products by 5 percent to 12 percent on Jan. 1 to compensate for the recent sharp decline in the value of the dollar against the Japanese yen, the company said yesterday.

The announcement appears to be a success for efforts of the five leading Western industrial nations to lower the dollar's value as a way of making goods imported into the United States more expensive and narrowing the huge U.S. trade deficit.

Sony of America, a subsidiary of the Japanese electronics giant, sells Walkman radios, Trinitron television sets, Betamax videocassette recorders and blank audio- and videotape, as well as professional television cameras and editing equipment.

U.S. electronics companies, among others, have complained that their Japanese rivals have had an artificial price advantage because of the dollar's buying power against the yen. That has helped stimulate calls for tariff barriers, which the Reagan administration has said could lead to a world trade war.

The Japanese yen has climbed nearly 15 percent against the dollar since the finance ministers of five major industrial nations met in New York on Sept. 22 and agreed to cooperate to lead the dollar lower.