Speculating on the exact cause of the CEL is pointless without the exact code.
Replacing the EGR valve/gasket is probably a waste of money without doing more checking first.
The most common EGR related problems on 'Tours is due to clogged EGR passages in the intake/TB.
A faulty EGR system can indeed cause pinging. Additional diagnostic work would be required to pinpoint the cause instead of throwing parts at it.
Steve