Your lawyer should get that money back for you when he does all the paperwork. That's how ours worked. Also did you send a letter in writing to your Association to let them know to stop charging you as of your closing date? If not, do it.
Our condo closed May 30, and we sent them a notice earlier in May to let them know not to charge us for June's. Also the lawyer settled the cost of what was left of the month, 1 day, that we got refunded back to us by the buyers of the condo. They do this with property taxes too.