We study an energy allocation problem for distributed estimation with sensor collaboration, where collaboration refers to the act of sharing measurements with neighboring sensors prior to transmission to the fusion center, and the sensors are equipped with energy harvesters to replenish their power from the environment. Based on the statistics of the harvested energy and dynamics of energy flow at each sensor, we propose a provably efficient online energy allocation policy for distributed estimation with sensor collaboration. The proposed online policy relies on solving an offline non-convex optimization problem, in which the estimation distortion is minimized subject to energy and network topology constraints. We employ semidefinite programming to find the globally-optimal solution of the non-convex problem. We show that the proposed online policy is asymptotically consistent and provide mean square error of the optimal offline solution over an infinite time horizon.