I'm pretty sure the answer is yes, even if it does NOT put anybody over the cap in any year.
Think about it: you have some extra cap room, so you agree to take on a 33-year-old with a $12 mil contract who isn't worth the money anymore (in steep decline), but fits your plans, fills a positional need, etc and it's the final year of his deal. While the trade is pending, the other owner signs him to a 5-yr/$50mil deal. Wouldn't you EXPECT that trade to be voided? I certainly would. The other owner is going to have to extend the player once the trade goes through, or you could do it and then resubmit the trade after it is voided.