ECM reduction is applied before the reduction for Gauss gun size. Otherwise, however, ECM is a subtracted rather than multiplicative effect.
The expression for beam fire accuracy looks like this:
ACC% = weapon_accuracy x [(BFC_tracking_speed * missile_tracking_bonus / target_speed) * (target_range - BFC_range) / BFC_range - 0.10 x (ECM_level - ECCM_level)]
neglecting some boundary limits and the effect of Tactical officer skill, which I'm still uncertain where it fits into the formula. In any case, this ensures that all sizes of Gauss gun are equally capable against ECM, so Gauss is not at any disadvantage versus railguns from ECM.
However, until ROF 8 tech Gauss cannons are strictly inferior to railguns when not turreted (which is usually the case for fighters) in terms of expected damage/DPS per ton. The only exception to this is at very low tech levels when 10cm railguns with Capacitor 1 or 2 will not achieve ROF 5, but this is a pretty low bar to clear outside of conventional starts with low research rates so it is rarely relevant. Otherwise, Gauss is not competitive with railguns even at ROF 5 or 6 tech.