We quantify the fraction of the cosmic infrared background (CIB) that originates from galaxies identified in the UV/optical/near-infrared by stacking 81,250 (~35.7 arcmin^(–2)) K-selected sources (K_(AB) 350 μm. The contribution from galaxies in the log(M/M_☉) = 9.0-9.5 (lowest) and log(M/M_☉) = 11.0-12.0 (highest) stellar-mass bins contribute the least—both of order 5%—although the highest stellar-mass bin is a significant contributor to the luminosity density at z ≳ 2. The luminosities of the galaxies responsible for the CIB shifts from combinations of "normal" and luminous infrared galaxies (LIRGs) at λ ≾ 160 μm, to LIRGs at 160 ≾ λ ≾ 500 μm, to finally LIRGs and ultra-luminous infrared galaxies at λ ≳ 500 μm. Stacking analyses were performed using SIMSTACK, a novel algorithm designed to account for possible biases in the stacked flux density due to clustering. It is made available to the public at www.astro.caltech.edu/~viero/viero_homepage/toolbox.html