The shrine had been built 200 years before by the practitioner called Kadayu sennin (hermit) who accompanied Emperor Tenji at the time of the transfer of national capital to Otsu by splitting the goshintai (object of worship housed in a Shinto shrine and believed to contain the spirit of a deity) and moving and enshrining it to the place called Ogi.
小椋神社はこれより遡ること約200年前、天智天皇の大津京遷都のおりに同行した加太夫仙人という行者が大和国の丹生川上神社から分霊を仰木の地に移し祀った。