This paper reports the tenth-order contributions to the g-2 of the electron a_e and those of the muon a_mu from the gauge-invariant Set II(c), which consists of 36 Feynman diagrams, and Set II(d), which consists of 180 Feynman diagrams. Both sets are obtained by insertion of sixth-order vacuum-polarization diagrams in the fourth-order anomalous magnetic moment. The mass-independent contributions from Set II(c) and Set II(d) are -0.116 489 (32)(alpha/pi)^5 and -0.243 00 (29)(alpha/pi)^5, respectively. The leading contributions to a_mu, which involve electron loops only, are -3.888 27 (90)(alpha/pi)^5 and 0.4972 (65)(alpha/pi)^5 for Set II(c) and Set II(d), respectively. The total contributions of the electron, muon, and tau-lepton loops to a_e are -0.116 874 (32) (alpha/pi)^5 for Set II(c) and -0.243 10 (29) (alpha/pi)^5 for Set II(d). The contributions of electron, muon, and tau-lepton loops to a_mu are -5.5594 (11) (alpha/pi)^5 for Set II(c) and 0.2465 (65) (alpha/pi)^5 for Set II(d).