Can a NATO member call Article 5 after being attacked outside its national borders?
The area covered by the treaty is stated in article 6 of the North Atlantic Treaty:
For the purpose of Article 5, an armed attack on one or more of the Parties is deemed to include an armed attack:
- on the territory of any of the Parties in Europe or North America, on the Algerian Departments of France2, on the territory of Turkey or on the Islands under the jurisdiction of any of the Parties in the North Atlantic area north of the Tropic of Cancer;
- on the forces, vessels, or aircraft of any of the Parties, when in or over these territories or any other area in Europe in which occupation forces of any of the Parties were stationed on the date when the Treaty entered into force or the Mediterranean Sea or the North Atlantic area north of the Tropic of Cancer.
2 On January 16, 1963, the North Atlantic Council noted that insofar as the former Algerian Departments of France were concerned, the relevant clauses of this Treaty had become inapplicable as from July 3, 1962.
So strictly the answer to your general question is yes. But it depends on the specific situation as laid out in article 6.
Assuming that the Turkish army gets involved in military action beyond its southeast border to Syria, what should the NATO do? Please consider three cases of military action: from Kurd troops, from Syrian national troops or from Russian troops.
In these cases, no. These are outside the territory of Turkey (so the first bullet point doesn't apply) and it's outside Europe and the mentioned territories (so the second bullet point doesn't apply either).
As stated in article 5 cited in Phoog's answer, it doesn't matter which of these parties perpetrates the attack for the purpose of invoking NATO article 5.