Dendrimers are highly branched organic macromolecules with successive layers or 'generations' of branch units surrounding a central core. Organic-inorganic hybrid versions have also been produced, by trapping metal ions or metal clusters within the voids of the dendrimers. The unusual, tree-like topology endows these nanometre-sized macromolecules with a gradient in branch density from the interior to the exterior, which can give rise to an energy gradient that directs the transfer of charge and energy from the dendrimer periphery to its core. Here we show that tin ions, Sn(2+), complex to the imine groups of a spherical polyphenylazomethine dendrimer in a stepwise fashion. This behaviour reflects a gradient in the electron density associated with the imine groups, with complexation in a more peripheral generation proceeding only after complexation in generations closer to the core has been completed. By attaching an electron-withdrawing group to the dendrimer core, we are able to change the complexation pattern, so that the core imines are complexed last. By further extending this strategy, it should be possible to control the number and location of metal ions incorporated into dendrimer structures, which might find uses as tailored catalysts or building blocks for advanced materials.