It is only the electrons from atoms in the ring that count when applying Huckel's rule. Electrons from substituents on the ring are only cross-conjugated with the aromatic π-system. When you think of it in terms of perturbational molecular orbital theory the substituent electrons take the part of a perturbation for the ring's aromatic system.
The reason for only using the ring electrons traces back to the origin of aromaticity. Take a look at the π-orbital energy levels of benzene (figure taken from p 36 of Fleming, Molecular Orbitals and Organic Chemical Reactions, Reference Edition):

Here, $\alpha$ is the energy of an isolated p-orbital and $\beta$ is the stabilization energy of the π-bond in ethylene. You can see that for benzene you get the best stabilization if you have 6 π electrons ($4n + 2$ for $n=1$) in the system because then you fill the stabilized MOs $\psi_1$, $\psi_2$ and $\psi_3$ which are lower in energy than an isolated p-orbital and gain the maximum stabilization energy possible. If you'd have more electrons in the system you would have to fill the destabilized MOs $\psi^{*}_{4}$, $\psi^{*}_{5}$ and $\psi^{*}_{6}$ which would cost a lot of energy because of the large energy gap between the bonding and antibonding MOs.
Now, what happens if you add a cross-conjugating substituent to the ring. This can be seen in the (Huckel-)MO-diagram of styrene (Fleming, p 71).

The main effects of the substituent are that the degeneracies of some orbitals are lifted and that the orbital energies shift a bit, especially those of HOMO and LUMO are of interest. In the case of styrene the HOMO lies higher in energy and the LUMO lies lower in energy compared to benzene. Now there are 4 stabilized energy levels instead of 3 - any electron that occupies one of those levels will lead to a stabilization of the molecule. But that is nice and well as you get 2 electrons from the substituent which will want to occupy one of the 4 levels and that leaves you with 3 levels that have to be occupied by ring electrons. Thus, your system will be most stable if the π-system of the ring contains 6 electrons, exactly like in benzene. Any more than 6 electrons will lead to destabilization as there is still quite a big HOMO–LUMO gap (even though it is smaller than in benzene).
The argument I made for styrene will remain valid for other molecules with different substituents (like aniline). The MO scheme of aniline will look a little different but the essential features should be the same.