The first thing to point out is that in this case elohim does not refer to G-d, but to an angel. As I wrote here the word elohim by definition means any power, in this case, the angel of Eisav. The idea that a person could struggle with G-d and emerge victorious is ridiculous on its face and betrays a shallow understanding of Judaism.
In fact, when the story is told over in the book of Hoshea 12:5 the verse is clear that Yaakov fought an angel:
וָיָּשַׂר אֶל־מַלְאָךְ וַיֻּכָל בָּכָה וַיִּתְחַנֶּן־לוֹ בֵּית־אֵל יִמְצָאֶנּוּ וְשָׁם יְדַבֵּר עִמָּנוּ׃
He strove with an angel and prevailed— The other had to weep and implore him. At Bethel [Jacob] would meet him, There to commune with him.
The general translation of שרית here is "struggled", but it is also connected to the term שר, which means a ruler or noble, as we also see with the name Sarah. See Rashi below for the explanation:
לא יעקב [THY NAME SHALL] NO MORE BE CALLED JACOB [BUT ISRAEL] (literally, “not Jacob — supplanting — shall any more be said to thee”) — It shall no longer be said that the blessings came to you through supplanting and subtlety but through noble conduct (שררה) and in an open manner. Because later on the Holy One, blessed be He, will reveal Himself to you at Bethel and will change your name. There He will bless you, and I shall be there and admit your right to them (the blessings). It is to this that the passage refers (Hosea 12:5), “And he strove with an angel and prevailed; he wept and made supplication unto him” — it means the angel wept and made supplication unto him (Jacob). What was the subject of his supplication? This is stated in the next verse: “At Bethel He will meet us and there He will speak with us — implying the request. “Wait until he will speak with us there, and then I will admit your right to the blessings.” Jacob, however, would not agree to this, and against his own wish he had to admit his right to the blessings. That is what is meant when it states (v. 30) “And he declared him blessed there”, that he begged him to wait and he did not agree to do so (cp. Genesis Rabbah 78:2).
So the proper translation of the verse would be
וַיֹּאמֶר לֹא יַעֲקֹב יֵאָמֵר עוֹד שִׁמְךָ כִּי אִם־יִשְׂרָאֵל כִּי־שָׂרִיתָ עִם־אֱלֹהִים וְעִם־אֲנָשִׁים וַתּוּכָל׃
And he said: Your name shall no longer be called Jacob [connoting gaining of the blessings by deception (akvah)], but Yisrael; for you have contended (saritha) with elohim (the angel of Esau) and with men [Esau and Lavan] and you have prevailed. [From Sefaria].