Google contacts are at Google Contacts and will sync to any phone you put on that Google account (which is why all contacts should be entered as Google contacts - which is NOT the default when you're entering a contact).
If you have Phone or Device contacts, you'll need the screen on the S3 to retrieve them. If they're SIM contacts, moving the SIM card to the S5 will move the contacts. (Then export them, and import them as Google contacts.)