An i5 2400 Sandy Bridge at 3.1 GHz is slightly behind the i5 2500K. That being said some games are starting to make even an i5 2500K OCed to 5 GHz feel its age, it would bottleneck a GTX 1060 for framerates above 70-90 in CPU intensive games.
However, as this CPU still has comparable IPC and single threaded performance as even the latest i7 7700K (Intel has been doing very incremental upgrades), this 6 year old CPU is still fine for gaming, but dont expect too extreme performance.
For a GTX 1050 Ti, you can leverage all of the GPU as long as resolution is above 1080p on most titles.
It will not bottleneck on most titles.
You may upgrade up to a GTX 1060 or RX 480.