Catalyzes the reduction of 5-keto-D-gluconate to D-gluconate, using either NADH or NADPH. Is likely involved in an L-idonate degradation pathway that allows E.coli to utilize L-idonate as the sole carbon and energy source. Is also able to catalyze the reverse reaction in vitro, but the D-gluconate oxidation by the enzyme can only proceed with NAD. D-gluconate + NAD(+) = 5-dehydro-D-gluconate + H(+) + NADH D-gluconate + NADP(+) = 5-dehydro-D-gluconate + H(+) + NADPH Carbohydrate acid metabolism; L-idonate degradation. Is up-regulated by L-idonate (15-fold) and by 5-ketogluconate (80-fold). Seems to be catabolite repressed. Is probably under the control of the positive regulator IdnR. Is part of the idnDOTR operon. Belongs to the short-chain dehydrogenases/reductases (SDR) family.