Mechanical engineering is applied math.
Therefore, if you have a math background, you're all set to be an engineer - no engineering classes required, right?
A good math background will make CS much easier. It is, however, a distinct discipline. For example, to study algorithmic complexity, some math is needed, so someone who already understands the pure math will have a head start. However, they still need to learn the patterns to quickly estimate complexity and be able to "see" which type of algorithm might have lower complexity.
In many ways, CompSci is to finite math as finite math is to arithmetic. You need arithmetic to learn all of finite math, because it's based on arithmetic, but it goes beyond arithmetic. So to CompSci requires knowledge of set theory and other finite math, but it goes beyond. See for example SQL, aka relational algebra and relational calculus. A math background will teach you about set operations, but SQL is set algebra on sets on tuples. You don't normally restrict sets of projected tuples in math class.