Somnus means "sleep". Somnium means "dream". One need not be an (ex) linguist to see these words are related, but they are distinct words with different meanings. I suppose you could work with both, but since you explicitly asked for "dream", I would recommend somnium.
Now ex is a preposition that always requires the ablative case. You can easily find the oblique forms (i.e. the forms of a word that are different from the dictionary form) at Wiktionary. From this we see that the ablative singular is somnio and the plural would be somniis.
Thus we can construct:
- ex somnio from a/the dream
- ex somniis from (the) dreams
(At this point you may be wondering: Hey, what about deus ex machina? No ablative there? It's the ablative too, but you only see it when vowel length is denoted in writing; the ablative of māchina is māchinā, and the expression is: deus ex māchinā. You would also hear the difference in spoken form if the speaker does correctly render vowel length, which in this case, even with experienced Latin speakers, is a bit hit-and-miss.)
There is also the adjective somnurnus, which is rare, but understood to be analogous to nocturnus etc., meaning: "belonging to sleep". In particular, the only use I find is: imagines somnurnae, meaning: "sights seen in sleep" - i.e., presumably when dreaming. The singular would be imago somnurna. But you can get creative and write: res somnurna (thing from the dreams) or animans somnurnum (being; I'd avoid animal, though that would work also), etc.