Your playing needs to be in the same key you're thinking about i.e. singing in, and there are basically two different approaches to do the coordination.
A: playing adjusts to singing: find the key you're singing in
B: singing adjusts to playing: give yourself a harmonic reference before starting to sing, in order to try and force the singing to be in a key and scale.
I guess alternative A is not suitable, because you can't seem to find the notes. So, try alternative B instead: play a strong chord cadence like C - F - G7 - C. After that your mind should be calibrated for C major, and your singing pitches should hopefully guide themselves to be in C. (Assuming that the idea you were thinking about was something where a major key is appropriate - if not, try a minor key, with something like Cm - Fm - G7 - Cm)
More generally speaking, not all ideas and feelings can be expressed in terms of e.g. piano keys at all, but experienced improvisers don't try to play things they can't play. As an analogy, it's possible to think about ideas that you find difficult to express using the English language - you try to put it in words, but whatever you say doesn't seem to cut it exactly. This is due to lack of practice, lack of patterns, known ways of expression suitable for that particular idea. You get better at self-expression by improvisation, doodling, babbling, producing expressions. As you do this, you train your mind to produce its ideas in terms of reproducible/performable actions. Play songs, melodies, chords, rhythms by ear.