Approach 3 - Spherical Coordinates
Considering that the UV map of a standard UV sphere is just angles in a spherical coordinate system, we can take the spherical coordinates of the cube an simply ignore the radius.
This will work provided the origin of the cube is the center of the sphere and if the sphere UV map is unchanged. (In your case the UV map is rotated 90 degrees, so simply rotate the cube in the end or add 90 degrees to the XY angle)

Approach 1 - Copy UV with Raycast
A naive approach with geometry nodes (as you can see it doesn't deal very well with the seams).
Subdivides the cube and samples the UV from the sphere.
Then you can use the same material in both objects.
(Some black glitches here are due to my machine, not the method)

This approach works as long as both origins are coincident and the sphere origin is at the center of the sphere.
Approach 2 - Transform the sphere into the cube
Also with raycast, this deals perfectly with the seams, but leaves the cube edges a little jagged (minimized with subdividing the sphere).
You can then bake this refined cube into a regular cube.

File with all approaches
