This should be your first stop.
HOWTO: Overclock C2Q (Quads) and C2D (Duals) - Guide v1.6.1
http://www.tomshardware.com/forum/240001-29-howto-overclock-quads-duals-guide
Shadow's Gigabyte motherboard OC guide:
http://www.tomshardware.co.uk/forum/page-245679_11_0.html
It's for an EP35-DS3L but all the Gigabyte Core2 BIOS's are similar.
Go through the guides. Then first thing you should do is go into the BIOS and change the System Memory Multiplier from AUTO to 2.00, 2.00B, or 2.00D - whichever you need to set the Memory Frequency to twice the FSB. Then when you increase the FSB, the memory clock will rise in step with it.
Warning - confusion factor between what the BIOS calls things and what CPUZ calls things. What the BIOS calls "memory frequency" is actually the memory clock. What CPUZ calls "memory frequency" is the real memory frequency, or half the memory clock - DDR2 RAM, remember? It transfers two chuncks of data each bus cycle. What you want in CPUZ is a 1:1 FSB:RAM ratio.
Overclocking memory doesn't accomplish much besides limiting your CPU overclock where the real speed comes from. Some of us discuss that here:
Overclocking RAM:
http://www.tomshardware.com/forum/251715-29-ratio-myth
You may not be able to reach 4.0 GHz. This is a "YMMV" thing. The best I was able to do with my particular E5200 was 3.78 GHz. (315 MHz X 12).
Next, you have no idea if your chip can run with a 400 MHz FSB even at lower internal multipliers.
Here's a thread where I comment some BIOS settings:
Overclocking E5200 on G'byte G31
http://www.tomshardware.co.uk/forum/256558-11-question-intel-e5200
----------
Overclocking since 1978 - Z80 (TRS-80) from 1.77 MHz to 2.01 MHz