(this is all to my understanding, if its wrong by all means tell me)
So, a team can not sign a free agent if they are over the cap (with the exception of using a Vet Min and the MLE), however, they can sign their own players an amount that exceeds the cap going into the Luxury Tax and beyond, yet have to pay higher amounts to the NBA.
So that's my basic understanding of it.
The question now is, in Free Agency can a team FIRST sign a free agent with the money they have left under the cap and THEN sign their own players?
For example, before the Wizards signed Gortat could they have signed Deng? (I only use him as an example because without that money going to Gortat we could have afforded what he's asking for, now we can't - Deng could be interchanged with any player... but you get the drift, this is only asking about salaries)