It depends on the depth of the division, but Id say winning over a top 5 fighter decisively should earn you a spot in a "next-in-line" matchup. That would ensure that every fighter has fought at least 2 "top-5's" before contending for a title.
For a shallow division (HW sort of currently, womens..) everything is kind of up in the air unfortunately. I would say a very big win (knockout, sub, completely dominating decision) over a top 5 could directly earn a challenger a title shot, but it would have to be pretty impressive.. like cain plowing bigfoot into paste impressive, or bj choking out pulver impressive.. brock vs heath herring.. Not saying those were top 5 guys defeated, just offering suggestions for what I consider "Impressive"
Of course, until we have some kind of official and widely accepted ranking system, its kind of a useless discussion.