Personally I would go for the i5 2500k and the 8gb first, are you changing motherboards as well? I am pretty sure motherboards only support DDR2 or DDR3 but not both. Anyways, the HD 5770 will do a fine job in gaming and the new CPU and ram will increase performance much better compared to you getting the video card first.
I will re-enforce my belief further, the HD 5770 is by all means a good video card and will hold its ground on many games even though its old. The i5 2500k will help push your frame rates higher, generally the i5s are known to be real good gaming CPUs.