Food Europe Spartans maintained their three-point lead at the top of SPFL League Two after a hard-fought 2-1 win over Dumbarton.