Given $[C;f]$, where $C$ is a finitely-generated $\pi$-projective chain complex, and $f:C \to C{\text {a(}}\pi {\text {,}}\varphi {\text {)}}$-chain map, with $\varphi :\pi \to \pi$ being a homomorphism, then the generalized Lefschetz number ${L_{(\pi ,\varphi )}}[C;f]$ of $[C;f]$ is defined as the alternating sum of the $(\pi ,\varphi )$-Reidemeister trace of $f$. In analogy with the ordinary Lefschetz number, ${L_{(\pi ,\varphi )}}[C;f]$ is shown to satisfy the commutative property and to be invariant under $(\pi ,\varphi )$-chain homotopy. Also, when ${H_\ast }C$ is $\pi$-projective, \[ {L_{(\pi ,\varphi )}}[C;f] = {L_{(\pi ,\varphi )}}[{H_\ast }C;{H_\ast }f]\] If $\pi â \subset \pi$ is $\varphi$-invariant and with finite index, then for $\alpha \in \pi â$, the $(\pi â,\varphi )$Reidemeister class $[\alpha ;\pi â]$ is essential for $f:C \to C$ if and only if ${[\alpha ;\pi ]_\varphi }$ is essential. If $\pi â \subset \pi$ is normal, then one can use the cosets of $\pi \operatorname {mod} \pi â$ to detect the essential $(\pi ,\varphi )$-classes of $f:C \to C$. This is expressed as a decomposition of ${L_{(\pi ,\varphi )}}[C;f]$ in terms of ${L_{(\pi â,{\varphi _\xi })}}[Câ;{f_\xi }]$ where $f( \cdot ){\xi ^{ - 1}} = {f_\xi }( \cdot )$ and ${\varphi _\xi }( \cdot ) = \xi \varphi ( \cdot ){\xi ^{ - 1}}$. The algebraic theory is applied to the Nielsen theory of a map $f:X \to X$, where $X$ is a finite CW-complex relative to a regular cover $\tilde X \to X$. One can define a generalized Lefschetz number ${L_{(\pi ,\varphi )}}$ using any cellular approximation to $f$, where $\pi$ is the group of covering transformations of $\tilde X \to X$. The quantity ${L_{(\pi ,\varphi )}}$ can be expressed naturally as a formal sum in the $\pi$-Nielsen classes of $f$ with their indices appearing as coefficients. From this expression, one is able to deduce from the properties of the generalized Lefschetz number the usual results of the relative Nielsen theory.