A tuff spot to be in. Your pre flop play isn't to bad if you want someone to call you. By only raising 5X the BB you gave them 2 to 1 odds to call you the next guy had 3 to 1. I like a 10X the BB raise. Now it is 1.4 to 1. The other option is all in pre flop. You'll win that race 9 out of 10 times. Win a little or lose a lot.
Once that flop hit you have to be able to lay down your hand be it AA, KK ect. What you did was you played your hand without asking yourself what does the better have? He could have had a set of 9's or the flush which is what he had.
So lets say you ask yourself what does the better have? I bet he has a flush or a set. Damn I hate to lay down AA with the nut flush draw. I can push all in with a semi bluff but if I am wrong I am gone. The correct play is to just call in this situtation. He's letting you see the next card almost for free. After the next card if you didn't get the nuts then again if he small bets call if he big bets let him have it and wait for your next chance.
Good luck at the tables!