What you are describing is not osmosis, it is capillary action. Capillary action is caused by the forces between the water molecules and the molecules of the tube overcoming the force of gravity. You can read more here: https://chem.libretexts.org/Bookshelves/Physical_and_Theoretical_Chemistry_Textbook_Maps/Supplemental_Modules_(Physical_and_Theoretical_Chemistry)/Physical_Properties_of_Matter/States_of_Matter/Properties_of_Liquids/Capillary_Action
Briefly, the water molecules are attracted to the molecules of the tube by adhesive force. The liquid molecules are also attracted to each other by cohesive force. The interplay of these forces causes capillary action.
However, it seems that tree sap moves by more than just capillary action. If you scroll down part way in this book they talk about it a bit: https://pressbooks.online.ucf.edu/phy2053bc/chapter/cohesion-and-adhesion-in-liquids-surface-tension-and-capillary-action/