Just make sure your video card supports 4K and shop for a monitor that supports 4K@60Hz via SST. MST seems to be a bit more troublesome and if you are buying new, I see no reason not to get SST instead.
5K is a bit more complicated. As far as I know, you need a video card that has at least two DisplayPort outputs because, presently, to drive a 5K monitor, you need to use two DisplayPort cables.