In this study, an Ag2S–CdS nanocomposite (AC11) was prepared through chemical co-precipitation of silver nitrate and cadmium acetate in an aqueous solution of thiourea. We then synthesized PACI, a nanocomposite of polyaniline (PANI) and AC11, through in situ polymerization of aniline in an AC11-containing solution, resulting in uniform embedding of the AC11 nanoparticles in the PANI fibers. Moreover, we synthesized the nanocomposite PACO through deposition of the AC11 nanoparticles on the surface of the PANI fibers. PANI, PACI, and PACO were then spin-coated onto conducting glasses to form PANI-S, PACI-S, and PACO-S counter electrodes, respectively, for dye-sensitized solar cells (DSSCs). Cyclic voltammetry revealed that the electrochemical catalytic activity of the PACI-S electrode was much higher than those of the PANI-S and PACO-S electrodes. Furthermore, the photovoltaic properties of the PACI-S-based DSSC were much better than those of the PANI-S- and PACO-S-based DSSCs. Indeed, the highest short-circuit current density (12.06 mA/cm2), open-circuit voltage (0.72 V), fill factor (0.58), and photoenergy conversion efficiency (5.04%) were those of the DSSC featuring PACI-S as the counter electrode.