Gene wants to become the top student in his class. Gene feels that he is in indirect competition with Finny. Achieving academic success is his most logical and likely way to attain some kind of victory or primacy over Finny; an accomplishment of his own.
Gene wants to study hard and do well in his classes. Before deciding to strive for the top spot, already "Gene is academically near the top of his high school class." He is close to the top of the class and craves the distinction of becoming the top student. Finny seems to be working to undermine Gene's efforts.
When Gene fails a test after a clandestine trip to the beach with Phineas, he decides that Finny is trying to jeopardize his studies.
Coercing Gene into taking a trip to the beach on the night before an exam and routinely dragging Gene away from his studies, Finny appears to be finding ways to keep Gene from achieving his goal.
Gene realizes that Finny is not competing with him and not envious of him. It is at this time that Gene causes Finny's fall from the tree.