The federal union that is trying to organize a boycott of businesses owned by J. Peter Grace, who has recommended cuts in federal pay and fringe benefits, says that the Internal Revenue Service has banned literature about the boycott from bulletin boards at IRS headquarters.

The boycott was launched six weeks ago by the National Treasury Employees Union. NTEU represents most IRS workers and feds in many other agencies. It is asking the 450,000 federal workers and retirees here not to patronize Grace-owned outlets until President Reagan and Grace, who headed the so-called Grace Commission, apologize for and cease "their assault on federal pay, retirement and employes." NTEU members have picketed the Devon Bar and Grill near George Washington University. They plan similar protests aimed at other Grace-owned firms such as Herman's Sporting Goods stores, Houlihan's Old Place, and Channel Home Centers.

Officials of the W.R. Grace and Co. have declined to comment on the boycott.

Three weeks ago the IRS refused to allow the union to post literature on headquarters bulletin boards that claimed that Grace and Company had "reaped a negative tax windfall of nearly $13 million" from 1981 to 1983. IRS rules prohibit posting of any taxpayer information in its buildings.

But NTEU President Robert Tobias said the union will protest an IRS "gag order" this week requiring the union to take down fliers describing the boycott and urging employes to join in.

"We've struck a nerve," Tobias said. He charged that the White House has pressured IRS Commissioner Roscoe L. Egger to "quash information about the boycott" to protect Grace's profitable businesses. Tobias claims the IRS action violates its contract with the union allowing it bulletin board space for union announcements. IRS officials said late yesterday they would have a response to the union's charges later on.

Jim Owens, deputy commissioner of the IRS said yesterday: "We have negotiated a contract with NTEU which provides that any material that reflects 'on the integrity or motives of any individuals . . . government agencies or activities of the federal government' may not be posted on official bulletin boards."

He said the "posters in question clearly violate this contractual agreement. Therefore they were disapproved for posting. On April 3 we offered to consider any alternative poster language. There was no response from the union.