Our team has experience shooting from plane to plane and helicopter as well as anything else moving or standing still.
No surprise, photographs of airplanes are usually taken from other airplanes. The aircraft being photographed will then fly formation on the photo plane. The photographer typically may pick a time of day when the lighting will be most conducive to good photographs.
The pilots are typically experienced in formation flight. There is always a briefing held before take off where they discuss all of the issues relative to flying formation, emergency procedures, loss of view, etc. and for the particular photo session they are about to have.
Once airborne, the photo-plane pilot flies the predefined route and the airplane being photographed stays in the proper formation. The photographer can signal or talk to the pilot of the airplane being photographed to indicate that the aircraft should change position.