The first basis of comparison between "The Lottery" and "Occurrence" that comes to mind is point of view.
Both stories feature effective surprise endings. Both surprises are achieved largely due to the points of view.
In "The Lottery," the detached, objective point of view reveals no character thoughts, and the narrator makes no authorial intrusions. Reporting only the setting, dialogue, and actions of the characters, the appearance of normalcy is achieved right up to the point the hideous abnormal is revealed.
In "Occurrence," the segment of the story that leads to the surprise ending is limited to only character thoughts, and the ending is achieved when those thoughts are cut short, so to speak. By revealing only the hanged man's thoughts, the narrator uses the stream of consciousness that the hanged man instantaneously experiences to lead the reader to experience his thoughts as actual, in real time, rather than as occurring in an instant.
Though the surprise is manufactured by leaving out character thoughts in one case, and revealing only character thoughts in the other, point of view is central to the successful surprise endings in both stories.
Additionally, the points of view also contribute to the legitimacy of the surprises once they occur by providing foreshadowing. In "The Lottery," details such as the collecting of stones by the boys make the ending legitimate. In "Occurrence," the fine, minute details the man experiences in the creek convince the reader that what he/she read could not actually be real, thus legitimizing the ending.