It really depends on the game and if you can overclock or not. The Q9400 is a 2.66Ghz chip while the E5800 is 3.2Ghz. So in most games you will lose performance due to the loss of clockspeed. Only a few games will perform better on a lower clocked quad than a higher clocked dual.
With a good motherboard and an aftermarket CPU cooler the Q9400 should overclock to ~3.5Ghz making it a better chip than a stock E5800. That being said an E5800 should hit ~4Ghz easily with the same board and cooler.
Honestly I would not spend money on a platform that old. Save the money for a full upgrade. The games that really need a quad core CPU need a powerful one for the most part.