X-ray CT is widely used, both clinically and preclinically, for fast, high-resolution, anatomic imaging; however, compelling opportunities exist to expand its use in functional imaging applications. For instance, spectral information combined with nanoparticle contrast agents enables quantification of tissue perfusion levels, while temporal information details cardiac and respiratory dynamics. In previous work, we proposed and demonstrated a projection acquisition and reconstruction strategy for 5D CT (3D + dual-energy + time) which recovered spectral and temporal information without substantially increasing radiation dose or sampling time relative to anatomic imaging protocols. The approach relied on the approximate separability of the temporal and spectral reconstruction sub-problems, which enabled substantial projection undersampling and effective regularization. Here, we extend this previous work to more general, nonseparable 5D CT reconstruction cases (3D + muti-energy + time) with applicability to K-edge imaging of exogenous contrast agents. We apply the newly proposed algorithm in phantom simulations using a realistic system and noise model for a photon counting x-ray detector with six energy thresholds. The MOBY mouse phantom used contains realistic concentrations of iodine, gold, and calcium in water. Relative to weighted least-squares reconstruction, the proposed 5D reconstruction algorithm improved reconstruction and material decomposition accuracy by 3-18 times. Furthermore, by exploiting joint, low rank image structure between time points and energies, ~80 HU of contrast associated with the Kedge of gold and ~35 HU of contrast associated with the blood pool and myocardium were recovered from more than 400 HU of noise.