Yes, EGR system is there to cool combustion temperatures when engine is under load, accelerating would be under load, this cooling lowers the NOx levels in exhaust.
And this cooling also prevents pinging/knocking as well.
Pinging is pre-ignition, air/fuel mix self ignites in the cylinder when compressed and slightly before spark plug fires, the noise is caused by more than one ignition point in the cylinder.
Octane is a heat rating, the lower the octane the lower its self ignition temp
Compression causes heat, engine under load heats up more.
9.0:1 compression ratio will usually run fine on regular 87 octane gas, above 9.4:1 you can start to get pinging on 87 octane.
4.0l SOHC has 9.7:1 so will not like 87 octane, what Ford did so you can use Regular gas is to add a Knock Sensor, when computer sees a knock it will retard spark timing so spark plug will ignite fuel before it can self ignite, knock sensors detect knock BEFORE you can hear it.
So if you hear a knock/ping then you could have a Knock Sensor problem, which is not uncommon on 4.0l SOHC
Your EGR system could be the problem but you should still not hear a ping/knock because of the Knock Sensor.
Try running a tank of '93 octane, pinging should go away and you should feel alot more power because spark is not being retarded.
If power is not greatly improved then knock sensor is bad so computer wasn't retarding the spark and thats why you hear pinging.