The well-known formalism for Sum-Frequency Generation (SFG) reflected or transmitted by a three-layer system involves three equations defining the emitted SFG intensity, the effective nonlinear susceptibility, and a set of Fresnel factors specific to the three-layer system. We generalize the equations to an N-layer system, where all media have non-vanishing thicknesses, by leaving the first two equations unchanged and modifying only the Fresnel factors. These universal Fresnel factors bear all the complexity of light propagation and interference in the system, in amplitude and phase. They are analytically known anywhere in the N-layer system, either at any interface or in any of the bulks, and share common expressions for the three beams, incoming or emitted, of the SFG process in reflection. Enclosing an ultrathin layer (e.g., a molecular monolayer) in the system does not modify the Fresnel factors except for boundary conditions at this layer, as in the three-layer case. Specific rules are elaborated to simplify systems containing macroscopic layers. Equations for the four- and five-layer systems are explicitly provided. Simulations in the four-layer system allow for the recovery of the results of the transfer matrix formalism at a lower complexity cost for SFG users. Finally, when several interfaces in the system produce SFG signals, we show that it is possible to probe only the most buried one by canceling all the SFG responses except at this last interface, generalizing the results of the three-layer system.