Let me assume that $Y$ is connected in order to simplify the discussion. First of all, the answer to your question is negative if $Y$ is compact, simply because then $Y$ has only constant holomorphic functions (which I understand as functions $Y\to {\mathbb C}$). Now, assume that $Y$ is noncompact. By a theorem of Behnke and Stein:
H. Behnke, K. Stein, Entwicklung analytischer Funktionen auf Riemannschen Flachen, Math. Ann. Vol. 120 (1949) p. 430–461.
the surface $Y$ is Stein, i.e. admits a holomorphic embedding in ${\mathbb C}^n$ for some $n$. In particular, given $q\in Y$ there exists a holomorphic function $g: Y\to {\mathbb C}$ such that $g'(q)\ne 0$. Restricting $g$ to a small neighborhood $V$ of $q$ we obtain that $g: V\to {\mathbb C}$ is biholomorphic to its image. Therefore, there exists a local chart $C_2=g|V$ at $q$ such that the composition $C_2\circ f \circ C_1^{-1}$ is holomorphic implying that $f$ is holomorphic in the sense of the definition 1.
Remark. Note that this question is different (but suffers from a deficiency similar to that of) the question
Show that a function from a Riemann Surface $g:Y\to\mathbb{C}$ is holomorphic iff its composition with a proper holomorphic map is holomorphic.
The difference between the two questions is that in the linked question it was asked to prove holomorphicity of $h: Y\to {\mathbb C}$ given holomorphicity of the composition
$$
X\stackrel{f}{\to} Y\stackrel{h}{\to} {\mathbb C}$$
where $f$ was the given proper function ($Y$ was assumed connected). In that question the missing assumption was that $f$ is nonconstant: (non)compactness of $Y$ was irrelevant.
If you need a reference, it is done in Bredon's "Topology and Geometry" for smooth mappings, but it's the same for holomorphic.
– xyzzyz Sep 15 '16 at 20:52