score:7
The short answer is no you don't have to go through immigration.
Considering that you will be travelling on a single ticket and your transit duration is less than 24 hours the following would apply
International transfer passengers flight routes issued on single ticket continuing to a foreign destination with Turkish Airlines*
- Passengers disembark with only their cabin baggage and proceed directly to the boarding gates without any flight or passport procedures.
- Passengers who have not obtained their boarding pass for the connecting flight at the initial point of departure must apply to the Turkish Airlines Transit Check-in desk.
*Including which flight routes issued on single ticket, Star Alliance members and airlines with a codeshare agreement with Turkish Airlines.