Conventional X-ray microcomputed tomography (micro-CT) is not usually sufficient to determine microscopic compositional distributions as it is limited to measuring the X-ray attenuation of the sample, which for a given dataset can be similar for materials of different composition. In contrast, the present work enables three-dimensional compositional analysis with a data-constrained microstructure (DCM) modeling methodology, which uses two or more CT datasets acquired with different X-ray spectra and incorporates them as model constraints. For providing input data for DCM, we have also developed a method of micro-CT data collection that enables two datasets with different X-ray spectra to be acquired in parallel. Such data are used together with the DCM methodology to predict the distributions of corrosion inhibitor and filler in a polymer matrix. The DCM-predicted compositional microstructures have a reasonable agreement with energy dispersive X-ray images taken on the sample surface.