Let $\xi \in Y$ be the generic point. Let $X_\xi$ be the scheme theoretic fibre of $\varphi$ over $\xi$. Denote $\mathcal{L}_\xi$ the pullback of $\mathcal{L}$ to $X_\xi$. Assumption (5) means that $\mathcal{L}_\xi$ is trivial. Choose a trivializing section $s \in \Gamma(X_\xi, \mathcal{L}_\xi)$. Observe that $X$ is integral by Lemma \ref{lemma-flat-over-integral-integral-fibre}. Hence we can think of $s$ as a regular meromorphic section of $\mathcal{L}$. Pullbacks of meromorphic functions are defined for $\varphi$ by Lemma \ref{lemma-pullback-meromorphic-sections-defined}. Let $\mathcal{N} \subset \mathcal{K}_Y$ be the $\mathcal{O}_Y$-module whose sections over an open $V \subset Y$ are those meromorphic functions $g \in \mathcal{K}_Y(V)$ such that $\varphi^*(g)s \in \mathcal{L}(\varphi^{-1}V)$. A priori $\varphi^*(g)s$ is a section of $\mathcal{K}_X(\mathcal{L})$ over $\varphi^{-1}V$. We claim that $\mathcal{N}$ is an invertible $\mathcal{O}_Y$-module and that the map $$ \varphi^*\mathcal{N} \longrightarrow \mathcal{L},\quad g \longmapsto gs $$ is an isomorphism. \medskip\noindent We first prove the claim in the following situation: $X$ and $Y$ are affine and $\mathcal{L}$ trivial. Say $Y = \Spec(R)$, $X = \Spec(A)$ and $s$ given by the element $s \in A \otimes_R K$ where $K$ is the fraction field of $R$. We can write $s = a/r$ for some nonzero $r \in R$ and $a \in A$. Since $s$ generates $\mathcal{L}$ on the generic fibre we see that there exists an $s' \in A \otimes_R K$ such that $ss' = 1$. Thus we see that $s = r'/a'$ for some nonzero $r' \in R$ and $a' \in A$. Let $\mathfrak p_1, \ldots, \mathfrak p_n \subset R$ be the minimal primes over $rr'$. Each $R_{\mathfrak p_i}$ is a discrete valuation ring (Algebra, Lemmas \ref{algebra-lemma-minimal-over-1} and \ref{algebra-lemma-criterion-normal}). By assumption $\mathfrak q_i = \mathfrak p_i A$ is a prime. Hence $\mathfrak q_i A_{\mathfrak q_i}$ is generated by a single element and we find that $A_{\mathfrak q_i}$ is a discrete valuation ring as well (Algebra, Lemma \ref{algebra-lemma-characterize-dvr}). Of course $R_{\mathfrak p_i} \to A_{\mathfrak q_i}$ has ramification index $1$. Let $e_i, e'_i \geq 0$ be the  valuation of $a, a'$ in $A_{\mathfrak q_i}$. Then $e_i + e'_i$ is the valuation of $rr'$ in $R_{\mathfrak p_i}$. Note that $$ \mathfrak p_1^{(e_1 + e'_1)} \cap \ldots \cap \mathfrak p_i^{(e_n + e'_n)} = (rr') $$ in $R$ by Algebra, Lemma \ref{algebra-lemma-normal-domain-intersection-localizations-height-1}. Set $$ I = \mathfrak p_1^{(e_1)} \cap \ldots \cap \mathfrak p_i^{(e_n)} \quad\text{and}\quad I' = \mathfrak p_1^{(e'_1)} \cap \ldots \cap \mathfrak p_i^{(e'_n)} $$ so that $II' \subset (rr')$. Observe that $$ IA = (\mathfrak p_1^{(e_1)} \cap \ldots \cap \mathfrak p_i^{(e_n)})A = (\mathfrak p_1A)^{(e_1)} \cap \ldots \cap (\mathfrak p_i A)^{(e_n)} $$ by Algebra, Lemmas \ref{algebra-lemma-symbolic-power-flat-extension} and \ref{algebra-lemma-flat-intersect-ideals}. Similarly for $I'A$. Hence $a \in IA$ and $a' \in I'A$. We conclude that $IA \otimes_A I'A \to rr'A$ is surjective. By faithful flatness of $R \to A$ we find that $I \otimes_R I' \to (rr')$ is surjective as well. It follows that $II' = (rr')$ and $I$ and $I'$ are finite locally free of rank $1$, see Algebra, Lemma \ref{algebra-lemma-product-ideals-principal}. Thus Zariski locally on $R$ we can write $I = (g)$ and $I' = (g')$ with $gg' = rr'$. Then $a = ug$ and $a' = u'g'$ for some $u, u' \in A$. We conclude that $u, u'$ are units. Thus Zariski locally on $R$ we have $s = ug/r$ and the claim follows in this case. \medskip\noindent Let $y \in Y$ be a point. Pick $x \in X$ mapping to $y$. We may apply the result of the previous paragraph to $\Spec(\mathcal{O}_{X, x}) \to \Spec(\mathcal{O}_{Y, y})$. We conclude there exists an element $g \in R(Y)^*$ well defined up to multiplication by an element of $\mathcal{O}_{Y, y}^*$ such that $\varphi^*(g)s$ generates $\mathcal{L}_x$. Hence $\varphi^*(g)s$ generates $\mathcal{L}$ in a neighbourhood $U$ of $x$. Suppose $x'$ is a second point lying over $y$ and $g' \in R(Y)^*$ is such that $\varphi^*(g')s$ generates $\mathcal{L}$ in an open neighbourhood $U'$ of $x'$. Then we can choose a point $x''$ in $U \cap U' \cap \varphi^{-1}(\{y\})$ because the fibre is irreducible. By the uniqueness for the ring map $\mathcal{O}_{Y, y} \to \mathcal{O}_{X, x''}$ we find that $g$ and $g'$ differ (multiplicatively) by an element in $\mathcal{O}_{Y, y}^*$. Hence we see that $\varphi^*(g)s$ is a generator for $\mathcal{L}$ on an open neighbourhood of $\varphi^{-1}(y)$. Let $Z \subset X$ be the set of points $z \in X$ such that $\varphi^*(g)s$ does not generate $\mathcal{L}_z$. The arguments above show that $Z$ is closed and that $Z = \varphi^{-1}(T)$ for some subset $T \subset Y$ with $y \not \in T$. If we can show that $T$ is closed, then $g$ will be a generator for $\mathcal{N}$ as an $\mathcal{O}_Y$-module in the open neighbourhood $Y \setminus T$ of $y$ thereby finishing the proof (some details omitted). \medskip\noindent If $\varphi$ is quasi-compact, then $T$ is closed by Morphisms, Lemma \ref{morphisms-lemma-fpqc-quotient-topology}. If $\varphi$ is locally of finite type, then $\varphi$ is open by Morphisms, Lemma \ref{morphisms-lemma-fppf-open}. Then $Y \setminus T$ is open as the image of the open $X \setminus Z$.