The cartoon character was created in 1958, while Yogi Berra was already a famous baseball player, even being nicknamed "Yogi" in the early 1950s. So, it's more likely that the cartoon character's name was inspired by the baseball player.
However, the creators of Yogi Bear have never confirmed this. It's possible that the name was chosen simply because it sounded funny and fitting for a bear character.