How to set a rule for pads of just one component in Altium Designer
You can make a rule that applies to objects associated with a specific footprint:



That said, most fab shops can handle clearances down to 4 mil with no cost premium, and generally they set pricing based on the tightest tolerance anywhere on a board in any case, so it might be easier to just lower the clearance rule for the whole board to whatever's needed to allow your STM32 footprint.