New York nearly caught up with California as the state with the most residents working for foreign bosses in 1986, according to newly compiled government statistics.

Nationwide, employment by foreign bosses rose 4 percent and Britain remained the biggest employer, the Commerce Department says in a report to be published in mid-June.Figures for 1987 will not be compiled until this time next year, a delay caused by the difficulty of collecting employment statistics from thousands of foreign-owned companies.

The report says 2.96 million Americans worked in 1986 for foreign bosses - specifically, operations other than banks that had at least 10 percent foreign ownership.

California held onto the No. 1 spot by just 27 people as its total shrank and New York's grew rapidly.

Next were Texas, New Jersey, Illinois, Pennsylvania, Ohio, North Carolina, Georgia and Florida. South Dakota was last, just behind North Dakota.

Utah ranked 39th with 11,630 employed by companies with at least 10 percent foreign ownership. The study did not disclose the names of the companies.

In spite of the attention that Japanese investors have received in recent years, they ranked only fifth as bosses of Americans behind the British, Canadians, West Germans and Dutch.

The Commerce Department does not disclose foreign employers by name, but it is obvious that some of the big deals of 1986 had an impact on the numbers.

For example, the $3.4 billion acquisition of Allied Stores Corp. by Canada's Campeau Corp. helps explain why Canada's U.S. employment jumped by about 75,000.

On the other hand, West Germany's overall U.S. employment dropped a whopping 100,000 largely because W.R. Grace & Co. no longer counted in its totals. Grace repurchased 26 percent of its shares from the Flick industrial group of West Germany for $596 million.

Although Japan's U.S. employment rose only about 2 percent, its heavy investments in the United States, especially financial companies, caused its U.S. assets to shoot up 51 percent.

With $96.7 billion in U.S. assets, Japan ranked third behind Britain's $133.8 billion and Canada's $129.5 billion.

The report, completed in early May, will be published in the May issue of the department's Survey of Current Business, which is released in mid-June.