Spurs edge ten-goal thriller