From Vietnam, together with A-37B, in 1976. Sukhoi got them in 1977.
Some of the features were taken from F-5 into the Su-27 development (that was already in it's 7th year by 1977), like way how the engine is attached to the fuselage, cockpit lights and panels layout, details of undercarriage and of hydraulic system.