Actually, I did a small amount of research. Pretty sure cut players do count towards the formula. What I read states:
"Cut players do not count in the number of players lost, because the original team had the option to keep that player. These additional picks are intended to provide compensation only for players who have a contract expire at the end of the year, and a team does not re-sign them."
I'm only guessing, but since it specifically states that they do not count towards "players lost", I'm assuming it has no affect on players acquired. So Ngata would have cost us about the equivalent of a 5th rounder had the Ravens cut him and we signed him.