Hi and welcome to iMore. Yes they use the same Lightning connector so they will work fine.
Remember though that if you use a third-party cable, make sure it is MFI (Made For Iphone) certified as you could potentially cause damage to your device with a cheap trashy cable.