As played, you really have no idea where villain is at. He could have the higher straight, he could have a spade flush, he could have a set of 9's, maybe he made two pair?...you have no idea.
As played, its a call in the dark here. You have a decent hand but could easily be losing. Its hard to say what exactly you should do, other than not wind up in this position.
Obviously, betting out at some points before the river would be good. First of all, in 5NL...i think a bigger bet than .20 into a .25 pot is in order when you hit a straight. I'd bet .40.....5NL will get a lot of callers no matter what, just put the money in the middle.
You have to come over the top on villains re-raise. You have no idea what he has at this point. Basically, QK is going to shove on you like %100 of the time. Flush draws, TPTK, two pair, and sets are all going to know they are behind, you have a straight, and you are going to make them call against the odds
Here is the other really big problem:
What was your plan when you called villains re-raise? Did you have a plan? You have got to think "hey, this guy came in for the re-raise on the turn, he is betting out on any river". So, here is the thing...if you know he is going to bet the next street, and you think you are behind, FOLD the turn to his re-raise. If you think you are ahead or don't know, then you have to come over the top yourself.
You are playing this hand like you have something like QK or AQ of spades. I might float those hands to give lower straights or flushes the rope to hang themselves. Your hand doesnt have the luxury of doing that. So, since you dont have the nuts, the second nuts, etc...you really really need to plan ahead.
Basically, you let an undefined hand get to the river when you are holding a strong but vulnerable hand. He may have nothing but a pair of Jacks or 9's at this point but you have no way of knowing that.