i7 is better than i5. It usually has better clock speeds, depending on the variant. It also has same amount of extra logical cores along with the physical cores depending on the generation, whereas the i5 is only restricted to physical cores.
For eg. the latest i5 8500 comes with 6 cores only...