There are a large number of criteria (Technical and Planned Owner <your> Usage)
that are used to make this decision.
3rd Generation Intel® Core™ i7 Processors
https://ark.intel.com/products/family/65506/3rd-Generation-Intel-Core-i7-Processors
4th Generation Intel® Core™ i5 Processors
https://ark.intel.com/products/family/75024/4th-Generation-Intel-Core-i5-Processors
===
Let's Deal with the obvious differences ..... DIfferent CPU Sockets (LGA1155; LGA1150)
Determine the specific Motherboard in these computers. The motherboard determines specific "Chipset" used. The features that these chipsets present (Rear I/O panel; Internal connections for Front I/O) may be important.
Panther Point: Ivy Bridge (B75, Q75, Q77, H77, Z75, Z77) : April 2012.
https://en.m.wikipedia.org/wiki/LGA_1155#Ivy_Bridge_chipsets
Lynx Point: Haswell (H81, B85, Q85, Q87, H87, Z87) : June 2013
Lynx Point: Haswell Refresh (H97, Z97) : May 2014.
https://en.m.wikipedia.org/wiki/LGA_1150#Haswell_chipsets
===
Personally, I would select the latest chipsets, unless there were known (widely reported) issues.
https://www.quora.com/What-is-the-difference-between-i3-i5-i7-and-2nd-gen-3rd-gen-4th-gen-5th-gen