From this answer:
In the Planetary Society's Senior Editor and Planetary Evangelist Emily Lakdawalla's article Fun with a new data set: Chang'e 3 lander and Yutu rover camera data there are several photos from
Chang'e-3 and the Yutu rover.
above: Chang'e 3 photographed by the Yutu rover, January 13, 2014 read more
Chinese Academy of Sciences / ...
Yet another example, this time involving a spacecraft that was photographed twice, by two different other spacecraft, beyond Earth orbit. The Beagle 2 Mars lander hitchhiked to Mars on the back of Mars Express, and, in a similar vein to Cassini–Huygens above, Mars Express photographed Beagle 2 after the two separated:
(Image by the European Space Agency, ...
In a similar vein to Organic Marble's answer:
The Phoenix lander was captured during its descent on May 25, 2008, hanging from its parachute with crater Heimdall in the distant background, and again after landing on Mars and deploying its solar panels, by the HiRISE camera on Mars Reconnaissance Orbiter.
The Apollo 13 Service Module was photographed from the Apollo 13 LEM on the way back to Earth.
Not sure if this is what you were looking for since they were part of the same mission, were on the way back to Earth and were not far away when they separated and the pictures were taken. On the other hand, they were NOT in orbit.
For a case with more extreme relative motion than most of the other answers, the Lunar Reconnaissance Orbiter (polar orbit) imaged the LADEE orbiter (close to equatorial orbit) in 2014:
The LADEE appears rather distorted because the image was taken with a pushbroom camera, not the more familiar framing camera, so LADEE moves between lines relative to the ...
You can also find photos of some Mars rovers from various orbiters/satellites:
Opportunity from Mars Reconnaissance Orbiter
After a planet-wide dust storm in June 2018 blocked the Opportunity rover's solar panels, NASA scientists waited for images from the planet to clear. This image, captured Sept. 20 by the Mars Reconnaissance Orbiter, was among the ...
The Mars Odyssey orbiter was photographed by Mars Global Surveyor in 2005.
Figure 1: Why There are Two Images of Odyssey
NASA's Mars Odyssey spacecraft appears twice in the same frame in this image from the Mars Orbiter Camera aboard NASA's Mars ...
LRO images of the Apollo landing sites. This is Apollo 11:
Cassini and Huygens: this is Huygens as seen by Cassini, 12 hours after Huygens was released.
Rosetta and Philae. During descent:
Philae's final landing location:
Hayabusa 2 and its many landers. This is a photo of Minerva-II-2 taken by Hayabusa 2:
Yes, here is a picture of the Curiosity lander spacecraft taken by the Mars Reconnaissance Orbiter. The picture was taken about one minute prior to the landing of Curiosity.
Image from https://www.space.com/16946-mars-rover-landing-seen-from-space.html
If landed craft are allowed, there are also pictures of Mars rovers from Mars orbiters, asteroid ...
The Longjiangs weren't the first. Here's a single snapshot taken by Japan's 1998 Nozomi, testing its camera en route to Mars (which is why it was far enough away).
Much earlier, Apollo 16 got almost the whole disc. Here's how they did it.