First question is, is your z5 rooted?
Is it running on custom rom or stock rom?
Download mtk engineering mode or mobile uncle tools.
Select mtk settings, go under connectivity, then cds information, radio info, selecty phone 1 and edit.
Now just add this command to it AT +EGMR=1,7,”then 15 digit of YOUR NEW IMEI NO”
And press "send at command" button.
sometimes it doesn't work so just make sure you put a space between the AT and the"+EGMR.."
It should work that way.
End of it all, USB debugging must be switched on for any of the above process.