What part of the brakes did you find, exactly? Just the calipers?
How do you know they're M5 brakes if they're from a 525?
I don't know all the ins and outs of the M5 braking system, but I'm pretty sure the calipers are not the only unique component. You may also need new lines, a new resevoir, master cylinder, etc.
Someone around here will know for sure. Sit tight.