1, 4, and 5 are [gz] and the others are [ks].
The letter 'x' has three pronunciations (with the usual exceptions for names and words taken from other languages).
‘x’ in initial position [z] as in xylophone, Xerox
‘x’+vowel [gz] as in exact, exam, exert
‘xh’+vowel [gz] as in exhaust, exhibit
otherwise [ks] as in box, six, except, extra, next