You need to take it to the dealer. It's not like pairing a bluetooth device, they need to delete the previous key from the car and also pair the new key. This can only be done with the computer systems they have.
2016 535d- Champagne Quartz-Venetian Beige Dakota Leather-Anthracite Trim-ZLL/ZDA/ZDB/ZCW/416/4NB/688/ZTG
2014 X5 xDrive 35d- Space Gray-Canberra Beige Dakota Leather-Fineline Oak Wood Trim-ZDA/ZCW/417/4FF/4NB/5DL/688
2013 535i GT / 2010 X5 xDrive 48i / 2005 X5 30i / 2003 745Li / 2001 X5 30i / 1995 525i