Currently, the pylons scripting commands family is lacking a command to get the turret path that owns/controls the given pylon. A new command to solve this problem may work as follows:
Description: Returns the vehicle turret path that owns/controls the given pylon.  for driver turret,  for gunner turret.
Syntax: vehicle getPylonTurret pylon
- vehicle: <OBJECT>
- pylon: pylon index (starting from 1) <NUMBER> or pylon class name from TransportPylonsComponent >> pylons <STRING>
Return Value: Turret path that owns/controls the given pylon. <ARRAY>
-  for driver turret.
-  for gunner turret.
This is somewhat related to T124949, however, this requests different functionality as a command to get the pylon magazines of a vehicle already exists.