Let $Y$ be a random variable that lives on the same space as the stochastic integral $\int\limits_a^b X_t dZ_t$ for stochastic processes $X$ and $Z$. I would like sufficient conditions such that the equality $$Y \int\limits_a^b X_tdZ_t = \int\limits_a^b YX_tdZ_t$$ is true. I know that if $Z$ is a right continuous $L^2$ martingale and $Y$ is bounded and measurable wrt to the $\sigma$-field at time $a$, then this equality holds true.
Can these assumptions be relaxed, in particular such that $Y$ needn't be bounded? I had the idea of identifying $Y$ with the process $(Y)_t$ and using Ito's product rule (see Product Rule for Ito Processes) to get $$d(X_tY_t) = Y_tdX_t+X_tdY_t+d[X_t,Y_t]$$ where the last two terms are equal to $0$ as $Y$ is pathwise constant. Then using something like $\int Y d(\int XdZ) = \int YXdZ$ should give me the desired equality without using boundedness.
Does this proof work?