The thing with Gilchrist is that he plays in a role with lesser competition. You look at the opening batsmen he is competing against (assuming Tendulkar is already selected):
Jayasuriya, Hayden, Watson, Mark Waugh .etc
Gilchrist lets you get the wicketkeeping role out of the way, whilst being an ATG ODI opening batsman.
Dhoni, in the middle order, should be compared to the likes of Bevan, Hussey and Kluesner in terms of a finishing role. 6 & 7 are the slots for that role - Bevan has one locked in - he's the best ever - and if you want to pick a side with 5 specialist bowlers, Kluenser has to take 7.
Dhoni is an ATG finisher, no doubt, but Bevan pioneered it and thus deserves a place, and Kluesner lets you have a much stronger bowling attack. Same thing would apply if it were Imran or Kapil at 7.
Australia were highly successful in the ODIs during Gilchrist's era because they could have that genuine all rounder at 7 - they didn't have to sacrifice a bowler to put them at 8, or a batsman to have them at 6 because the 'keeper was a middle-order batsman. Gilchrist, by opening, solved that problem.
Comparing their averages is fallacious - Dhoni is a finisher, he remains not out either because the overs expire or the game ends. Gilchrist, coming in first, does not have that luxury. Dhoni averages ~37 per trip to the crease (he has 53 not outs), whereas Gilchrist averages ~34. I'm not one for discounting not-outs, batsmen can be too good for bowlers and hence remain not out, but I think we can see the way Dhoni's batting position influences his average.
tl;dr Gilchrist lets you pick an extra all-rounder/middle order bat while being a good opening batsman.
stl;dr Gilly > Dhoni, IMO. Dhoni still an ATG.