DDR memory does not mean much between DDR3 and DDR4 insofar as gaming FPS. I have not seen the two CPUs directly comparied, but my money would be on the older Ivy Bridge 3rd generation i5 still being better than the newer Pentium G4560. This is especially the case for games that utilize more than two cores. And there are a lot of them.
Here's a GTA V benchmark test of the i3 7350k showing where the Haswell G3258 stacks up against the i5 4690. It should give you an example of which chip, even though your question is among several generation chips in difference, stack up:
https://www.anandtech.com/show/11083/the-intel-core-i3-7350k-60w-review/9
Bottom line: a several generation old i5 > newer generation G-series Pentium.