  An explicit formula is obtained for the generalized Macdonald functions on
the $N$-fold Fock tensor spaces, calculating a certain matrix element of a
composition of several screened vertex operators. As an application, we prove
the factorization property of the arbitrary matrix elements of the multi-valent
intertwining operator (or refined topological vertex operator) associated with
the Ding--Iohara--Miki algebra (DIM algebra) with respect to the generalized
Macdonald functions, which was conjectured by Awata, Feigin, Hoshino, Kanai,
Yanagida and one of the authors. Our proof is based on the combinatorial and
analytic properties of the asymptotic eigenfunctions of the ordinary Macdonald
operator of $A$-type, and the Euler transformation formula for Kajihara and
Noumi's multiple basic hypergeometric series. That factorization formula
provides us with a reasonable algebraic description of the 5D (K-theoretic)
Alday-Gaiotto-Tachikawa (AGT) correspondence, and the interpretation of the
invariance under the preferred direction from the point of view of the
$SL(2,\mathbb{Z})$ duality of the DIM algebra.
