We consider the generalization of the S-duality transformation previously investigated in the context of the FQHE and s-wave superconductivity to p-wave superconductivity in 2+1 dimensions in the framework of the AdS/CFT correspondence. The vector Cooper condensate transforms under the S-duality action to the pseudovector condensate at the dual side. The 3+1-dimensional Einstein-Yang-Mills theory, the holographic dual to p-wave superconductivity, is used to investigate the S-duality action via the AdS/CFT correspondence. It is shown that in order to implement the duality transformation, chemical potentials both on the electric and magnetic side of the duality have to be introduced. A relation for the product of the nonabelian conductivities in the dual models is derived. We also conjecture a flavor S-duality transformation in the holographic dual to 3+1-dimensional QCD low-energy QCD with non-abelian flavor gauge groups. The conjectured S-duality interchanges isospin and baryonic chemical potentials.