Spartans win thriller over Williamsburg