According to Wikipedia
"... despite his peasant origins, in 1568 Hideyoshi became one of Nobunaga's most distinguished generals, eventually taking the name Hashiba Hideyoshi (羽柴 秀吉). The new surname included two characters, one each from Oda's right-hand men, Niwa Nagahide (丹羽 長秀), Shibata Katsuie (柴田 勝家) and Akechi Mitsuhide (明智 光秀), Mori Yoshinari (森 吉成) "
Why did Hideyoshi need to take his name from others? Could he not request his own unique name?Was this commonly done?
There's no way his personal name is based on Akechi Mitsuhide and Mori Yoshinari. Not only does it not appear in the sources, the name Hideyoshi appears before Akechi Mitsuhide joins Oda Nobunaga.
As for why the clan name of Hashiba was picked from Niwa and Shibata, the sources simply doesn't say. Even this itself is not found in contemporary records, but early Edo chronicle, and we know from surviving contemporary records that the Edo chronicle got the date wrong, so it might have got the reason wrong as well. But it is what we have given our scarce sources. However there's nothing to suggest that he needed or was forced to take his names from others. It's usually assumed he picked the name himself.