A great deal depends on the sensor build quality and the print size.
Cramming 24 mp on a DX sensor usually will not produce more resolution because of the density. Likewise, a FX sensor with 4 mp will have poor resolution.
A 4x6 inch print will not show noticable quality issues, but blow up an enlargment to 20x30" or larger and the 6 mp camera shows its limitations with each increase in size.
You must ask yourself what size prints do you want, what are you photographing, the amount of your budget, and your level of expertise.