A criterion for algebraicity of certain analytic elliptic surfaces