CHICAGO—Apollo Management Holding LP, a large New York private-equity firm, plans to buy some stores owned by Wild Oats Markets Inc. if the planned sale to its larger rival, Whole Foods Market Inc., is approved, according to a court filing.

John Mackey, Whole Foods’ chairman and chief executive, said in an entry on his blog Tuesday that Whole Foods has negotiated a deal with “a large private-equity firm” to sell the Henry’s and Sun Harvest farmers-market brands owned by Wild Oats. He didn’t specify how many stores are involved, but Wild Oats owns 29 Henry’s stores in California and eight Sun Harvest stores in Texas.

In a court filing earlier this week in the Federal Trade Commission’s lawsuit seeking to block Whole Foods’ $565 million purchase of Wild Oats, Apollo Management said it has contracted to buy “certain Wild Oats stores” in the event the deal is completed. The filing became public Wednesday.

A spokesman for Apollo declined to comment. Spokespeople at Whole Foods and Wild Oats weren’t immediately available to comment.

Apollo also said in the filing that it previously explored a potential purchase of all of Wild Oats. Apollo’s filing was designed to prevent certain “highly confidential information” about its business plans and acquisition strategies from being made public in the FTC’s lawsuit. Apollo also gave a number of documents to the FTC in April as part of the antitrust enforcer’s review of the Whole Foods-Wild Oats deal.

Apollo’s filing doesn’t list a price for the proposed purchase of the Henry’s and Sun Harvest stores. In his blog entry, Mackey said the Henry’s and Sun Harvest stores account for about 30 percent of Wild Oats’ total sales, which were $1.2 billion last year.

Last February, Austin, Texas-based Whole Foods agreed to buy Boulder, Colo.-based Wild Oats for $18.50 a share in cash. The FTC sued to block the deal on June 6, saying it would reduce competition and raise prices for consumers. The companies compete in more than 20 metropolitan areas, including Los Angeles, Boston, Chicago, Denver and Phoenix.

Whole Foods, founded in 1980, has 195 stores in the U.S., Canada and the United Kingdom. Wild Oats, founded in 1987, has 110 locations in 24 states and British Columbia, Canada. The companies have combined annual sales of about $6.8 billion.

Florida’s state social services agency investigated Nikolas Cruz’s home life more than a year before police say he killed 17 people at his former high school, closing the inquiry after determining that his “final level of risk is low,” despite learning that the teenager had behavioral struggles and was planning to buy a gun, according to an investigative report.