It is a bit fiddly.
All you need is a spreadsheet and a bit of patience.
As I said, 5 winners and 0 winners are easy. Just the cumulative probabilities of 5 losses and 5 wins.
For 1 winner, you need to work out the prob of Horse A winning, in an accumulator with losses for Horses B through E. Then add this to the prob of Horse B winning in an accumulator with a loss for Horse A and Horses C through E. And so on until you have all 5 permutaitons of 1 winner.
Then convert the prob into odds.
4 winners is similar. Just 5 different accumulators of 4 losers and 1 winner.
3 and 2 winners....for each of these there are 10 different possibilities. For example, 2 winners would be AB, AC, AD, AE, BC, BD, BE, CD, CE, DE.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
I suggest you set the spreadsheet up for 10 eventualities....if there are only 5 races or 5 matches, you can just set the odds for the last 5 events to be 100% chance of a win....
Not sure if that makes sense....as always with statistics, ability to understand is heavily dependent on how well it is explained.