Depends on the specifics. In this case one of the two companies involved is headquartered in the EU, so the mechanisms are the same as if two EU companies were trying to buy eachother.
Now if we assume a more interesting situation where neither of the companies are headquartered in the EU, but still do business in the EU. Then the number of mechanisms shrinks, but not by much. The EU could just fine the companies out of existance for not complying. See examples of the EU fining Microsoft, Google, or Facebook. Not that they stopped existing, but it shows that the EU can successfully fine these companies. Another example more closely related to buying is ARM. ARM is owned by a Japanese company, and Nvidia (a US company) is seeking to buy it. Yet the EU is looking into whether they'll allow it. [1]
The fewest options are in the case where both companies are fully located outside the EU and do no business in the EU. However if some of their subcontractors are in the EU, then go back to the paragraph above. Now if these two companies are are fully, along with their full supply chain, outside of EU jurisdiction. Then the options get pretty slim. Most efficient mechanism probably being diplomatic talks. EU diplomats could ask a country that has jurisdiction (say the US) to block the sale, and in return the US would get some sweet gains elsewhere. Classic diplomatic bargaining.
--
[1] https://www.theverge.com/2021/10/27/22266504/nvidia-arm-deal...