In the theory of de Branges Hilbert spaces of entire functions, so-called ‘functions associated to a space’ play an important role. In the present paper we deal with a generalization of this notion in two directions, namely with functions N-associated \(({N \in\mathbb {Z}})\) to a de Branges Pontryagin space. Let a de Branges Pontryagin space \({\mathcal {P}}\) and \({N \in \mathbb {Z}}\) be given. Our aim is to characterize whether there exists a real and zerofree function N-associated to \({\mathcal {P}}\) in terms of Kreĭn’s Q-function associated with the multiplication operator in \({\mathcal {P}}\) . The conditions which appear in this characterization involve the asymptotic distribution of the poles of the Q-function plus a summability condition. Although this question may seem rather abstract, its answer has a variety of nontrivial consequences. We use it to answer two questions arising in the theory of general (indefinite) canonical systems. Namely, to characterize whether a given generalized Nevanlinna function is the intermediate Weyl-coefficient of some system in terms of its poles and residues, and to characterize whether a given general Hamiltonian ends with a specified number of indivisible intervals in terms of the Weyl-coefficient associated to the system. In addition, we present some applications, e.g., dealing with admissible majorants in de Branges spaces or the continuation problem for hermitian indefinite functions.