McCormick and Co., the Baltimore spice company that successfully fended off an unfriendly take-over attempt this spring, yesterday went to the aid of another flavoring firm that was resisting an unwelcome suitor.

McCormick announced it has agreed to merge with Stange Co. of Chicago and to buy out a large block of Stange stock that was purchased earlier this year by Iroquois Brands Ltd.

The agreement calls for McCormick to buy 9.9 percent of Stange's stock from Iroquois for $2.3 million, then to acquire the remainder for a combination of cash and McCormick shares, said Richard W. Single, assistant secretary of the Baltimore firm.

Stange, which sells flavorings and colorings mostly to the food-processing industry is to become a subsidiary of McCormick, which does most of its spice and flavoring business at the retail level, Single said. Stange's headquarters will remain in Chicago, and the company will continue to be run by its present management if the merger with McCormick is completed.

The transaction requires the approval of Stange stockholders and the Securities and Exchange Commission.

Stange executives refused to meet with Iroquois Brands to discuss a possible merger with that company but have endorsed the combination with McCormick and agreed to vote their stock in favor of the merger, McCormick's representative said.

The chairman of the board, the president of Stange and their families own about 12 1/2 percent of that company's shares, which are traded on the American Stock Exchange. That is the largest block of the stock, and the 9.9 percent owned by McCormick is the second-largest holding.

Iroquois -- whose brands include Champale, Yoo-hoo soda and Major Grey's chutney -- last June bought an interest in Stange and requested a meeting to discuss acquisition of the Chicago firms. Stange responded by suing Iroquois.

Saying Iroquois "prefers to work in a friendly manner with the management of companies it invests in," Iroquois announced yesterday it had sold its stock to McCormick. McCormick will pay $13.25 a share for the stock, which Iroquois bought for an average of $8.25 a share; Iroquois will make a $900,000 profit on the sale.

McCormick said it will offer to buy up to 400,000 additional shares of Stange stock for $13.25 in cash and to obtain the remainder in a tax-free exchange for McCormick shares.

Acquisition of the Chicago firm, which had sales of $57 million last year, would expand McCormick more heavily into bulk sales of food flavorings and coloring.

Single said McCormick executives had long been familiar with Stange's business and agreed to help that company avoid the approaches of Iroquois.

McCormick itself fought off a takeover attempt by Sandoz Ltd., the Swiss drug company, earlier this year.