He gave the dog(собака) to my friend(мой друг).
Он дал собаку к моему другу.
What are the cases for 'dog' and 'my friend).
And should I change the ending according to the case for only the word 'friend' or 'my friend' (мой друг-> моему другу) in this sentence?