We present lifetime measurements of the 5D(3/2) and 5D(5/2) states of rubidium using the time-correlated single-photon-counting method. We perform the experiment in a magneto-optical trap of Rb-87 atoms using a two-step excitation with the trap laser at 780 nm as the first step. We record the 761.9 nm fluorescence from the decay of the 5D(3/2) state to the 5P(1/2) state, and measure the lifetime of the 5D(3/2) state tau=246.3(1.6) ns. We record the 420.2 nm fluorescence from the cascade decay of the 5D(5/2) state to the 5S(1/2) state through the 6P(3/2) state, and extract the lifetime of the 5D(5/2) state tau=238.5(2.3) ns.