Radial velocity might be able to detect Jupiter in the 5 or 500 light-years cases unless the solar system were oriented close to face-on. There is nevertheless the potential for confusion with the solar activity cycle at a similar period (this issue has come up for a couple of extrasolar Jupiter-analogues), which may require a very long campaign over multiple Jovian orbits to disentangle. A longer campaign might be able to detect Saturn, and a long campaign with something like ESPRESSO might be able to get Venus and perhaps the Earth, provided the Sun was being sufficiently quiet at the time.
The question of whether the Sun would be seen as a sufficiently high-value target that would justify such intensive radial velocity campaigns is another matter. At 5 light-years, the answer would probably be yes given the dedicated campaigns for Alpha Centauri. At 500 light-years it would likely be passed over in favour of systems that get more results more quickly.
At 50,000 or 5,000,000 light years, the Sun would be too faint for radial velocity measurements.
Gaia would probably be able to detect Jupiter by astrometry at 5 light-years semimajor axis of the reflex orbit of the Sun would be 3.2 milliarcseconds. At 500 light years this reduces to 32 microarcseconds, which may or may not be detectable: the precision listed for the brightest stars is 10 microarcseconds over the 5-year mission, while individual measurements may have errors of around 60 microarcseconds.
At 50,000 or 5,000,000 light-years, the astrometric wobble caused by the planets would be too small to detect even if the Sun itself could be seen.
Transits would probably detect most of the planets if the orbits were suitably oriented, though Mars and Mercury would likely evade detection and the outer planets would be single-transit events. Note that the Solar System isn't sufficiently flat to be able to detect all of the planets this way, you'd only get a subset of them.
Geometrical effects would make the transits of the outer planets less probable, and the long transit durations would require continuous observation (so these days, that would likely mean the Sun would have to be in one of the TESS continuous viewing zones).
This would be viable at 5 or 500 light-years. At 50,000 or 5,000,000 light-years the Sun would be too faint to make a useful target.
Our planets are a lot older than the planets that have been discovered so far by direct imaging, so our gas giants are a lot less luminous. There are ongoing campaigns to detect planets around Alpha Centauri by imaging, so possibly we're approaching the stage where some of the planets (maybe Jupiter is sufficiently large and well-separated to compensate for its lower illumination) would be on the edge of detectability at 5 light-years. Beyond that it's probably a no-go.
The emissions from the Jupiter–Io system would be the best prospect for detection of the solar system planets by radio emission, at 5 light-years this might be within reach of LOFAR. Radio detection of exoplanets is a fairly new area, so far there's only been one claimed detection: GJ 1151 and its planet appear to be behaving like a scaled-up version of Jupiter–Io.
Unless the Sun had sufficiently well-aligned proper motion with a sufficiently well-characterised background source, microlensing is unlikely to be of much use at 5 or 500 light-years. Lensing has been used to measure the gravitational mass of Proxima Centauri, but the observations didn't reveal anything about its planets.
The 50,000 light-year is about twice as far as the furthest planet-hosting lenses known. In the typical case microlensing is sensitive to planets near the snowline, so could probably detect Jupiter and the outer planets provided they appear (in projection) sufficiently close to the Sun. It would be tricky to directly detect the Sun so the parameters would likely assume an M dwarf host star. You might also see an outer planet without detecting the Sun, so all you'd know is there's a (roughly) Neptune-sized planet that might be in a wide orbit or in interstellar space.
Microlensing surveys target crowded stellar fields (e.g. towards the Galactic Centre) to get the best chance of spotting an alignment. If the Sun were in a relatively empty part of the sky then such an event would likely be missed because the surveys wouldn't be looking in this direction.
At 5,000,000 light-years you're at about twice the distance to the Andromeda Galaxy. There has been a claim of a planet detection by pixel microlensing in the Andromeda Galaxy in the PA-99-N2 event so maybe you could detect Jupiter if you were lucky, assuming your Sun at 5,000,000 light-years is located in a galaxy rather than in intergalactic space. At this distance you wouldn't be able to detect the Sun directly, so the information you'd have would be extremely minimal: at best you'd be able to say that a system with a mass ratio of ~0.001 exists somewhere within its galaxy.
In both of these cases, you'd be relying on a survey of brightness variations in a stellar field, rather than selecting the Sun as a specific target. Furthermore the event wouldn't repeat, making follow-up observations very difficult.