Let $Y$ be a connected CWcomplex and $X\subset Y$ a connected CWsubcomplex. Suppose that each cell of $X$ is the boundary of a cell of $Y$. Is this enough to conclude that $X$ is contractible in $Y$ (the inclusion map is homotopic to a constant map)? If the answer is no, then which condition could be enough to get the contractibility?

If you mean that every cell in $X$ is the image of the boundary of a cell in $Y$ then the answer is no  consider for example the standard inclusion $S^1 = RP^1 \hookrightarrow RP^2$. The boundary of the $2$cell is $RP^1$ (but it runs around twice, so $\pi_1 (RP^2) = \mathbb{Z}/2$ and the $1$cell represents the generator). 


The condition "each cell of $X$ is the boundary of a cell in $Y$" is very strong. In particular, it implies that each cell of $X$ is attached to the rest of $X$ by a constant attaching map (otherwise, it would have no chance of being the boundary of something else) Thus, $X$ is a wedge of spheres. I think that, at this point, it is easy to see how to finish the argument and answer the question in the affirmative: yes $X$ is contractible in $Y$. I feel however, that the question asked maybe wasn't the one intended. 

