The electrostatic interactions mediated by counterions between a cationic PAMAM dendrimer, modelized as a sphere of radius and cationic surface charge highly increasing with generation, and a DNA, modelized as an anionic elastic line, are analytically calculated in the framework of condensation theory. Under these interactions the DNA is wrapped around the sphere. For excess phosphates relative to dendrimer primary amines, the free energy of the DNA-dendrimer complex displays an absolute minimum when the complex is weakly negatively overcharged. This overcharging opposes gene delivery. For a highly positive dendrimer and a DNA fixed by experimental conditions to a number of phosphates less than the number of dendrimer primary amines, excess amine charges, the dendrimer may at the same time bind stably DNA and interact with negative cell membranes to activate cell transfection in fair agreement with molecular simulations and experiments.