The name Stockdorf was first mentioned in a deed of Benediktbeuern monastery 1279 as "Stochdorf".
The reform of the Bavarian administration under Montgelas lead to the annexation of Stockdorf by Gauting between 1808 and 1818.