In this case just looking up words in a dicitonary without looking closely at context may be confusing indeed.
The example you gave also is a good example of how this confusion can arise. Of course does Gesang translate to singing but in this case it is not the English present continuous of to sing but it is the noun the singing.
To overcome this we should have a dictionary providing some context or possible variations where it comes clear that we are looking for different forms and inflection. A good overview on inflection of singen can be found at canoonet.eu.
Then it may come clear that "sing to yourself" needs the imperative form of singen. Hence a literal translation may be
Sing(e) zu dir selbst.
However this is not very idiomatic. Looking at the English to German translation of "to sing to sb" we will find the different verb vorsingen in the list. Hence the following translation will go better:
Singe dir selbst vor.
We will have to look up the inflection of vorsingen then to get it right in different tenses.