This does depend on the scoring method somewhat as well as the cards, but "almost never".
Hamman's rule: "If you have a choice of reasonable bids and one of them is 3NT, then bid it." You never want to play 5m instead of 3NT. Sometimes you have to, however. It should be obvious from your hand (though less so after a strong NT opener, definitely not obvious from a 2NT opener).
The same things apply as deciding to play 3m instead of 1NT:
- suit you aren't sure is reasonably solid (though remember for 5m it can't really be much more than one loser), or
- that you can't guarantee you can get to in NT once declarer sets it up.
The fact that you have zero losers in some other suit because you're void doesn't really matter as much if partner has it stopped and your suit runs - you have two more tricks you can afford to lose in 3NT than at the 5 level. Of course if it's not going to run, theirs is...
But really, the big time to play 5m instead of 3NT is "tried for 6 and had to stop." Note that again, it's "don't want to be there, but have to."
Now, none of that depends on the scoring method. So why did I mention it first? Because matchpoints.
If you can take 11 or 12 tricks in a minor suit, the chance of taking 10 or 11 in 3NT is quite high. If you're playing IMP scoring, or rubber, then the difference between 5m making and 3NT making is tiny (zero, or -1 or 2 IMPs (30 or 60 points above the line) if 3NT made overtricks). If you're in a matchpoint game, though, while 5m= ties 3NT=, even 5m+1 loses to 3NT+any. The only time you win at matchpoints by playing in the minor is when 3NT fails.
There's a line that is often said as a joke, but it's not wrong: "At matchpoints, 5m is an invitation to 6" - because if you're booked for a poor score anyway for playing in the minor, the upside of bidding 6 (below average -> top) when it makes is much larger than the downside of bidding 6 when it doesn't (below average -> bottom).
There's another comment that fits this discussion: "At matchpoints, play the highest scoring contract. At IMPs, play the safest contract." If you can't tell which one's safer, almost certainly 3NT is.
Long answer shortish: over 1NT, only plan on 5m instead of 3NT if it's obviously right. Over 2NT, you never want to play in 5m. If you look for slam and are off two keycards, sure, stop in 5m, but you're not getting a good (matchpoint) score.