This is a follow up question to Weight filtration for smooth analytic manifolds
As mentioned in that question, the integral cohomology of some smooth complex analytic manifolds is equipped with a weight filtration. The construction generalizes Deligne's weight filtration on the rational cohomology of a smooth algebraic variety: we compactify if we can a smooth complex analytic manifold as the complement of a normal crossing divisor and take the Leray filtration (i.e. the filtration given by the Leray spectral sequence of the open embedding of the manifold into the compactification). This time we do not get an invariant but rather an invariant of an equivalence class of compactifications where two compactifications are called equivalent iff one dominates the other.
The non-invariance is relatively easy to see: indeed, take is a rank 2 vector bundle on an elliptic curve which is a nontrivial extension of the trivial bundle by itself. The bundle admits a section hence so does its projectivization; set $U$ equal to the total space of the projectivization minus the section. One can show that $U$ is analytically isomorphic to $\mathbf{C}^\ast \times \mathbf{C}^\ast$. So $U$ has two different compactifications, one of which (a $\mathbf{P}^1$-bundle over an elliptic curve) gives weight 1 classes in $H^1$ and the other one -- $\mathbf{P}^1\times \mathbf{P}^1$ -- does not. See e.g. Peters-Steenbrink, Mixed Hodge Structures, p. 102.
The fact that we do get an invariant of the equivalence class of compactifications is a bit trickier but not massively so; I think I understand now how to prove it.
But still the question arises: does the weight filtration on the integral cohomology have any of the nice properties of the weight filtration on the rational cohomology of algebraic varieties. A particularly nice property is the strict compatibility with respect to the maps induced by morphisms of varieties. Recall that this means that is $f:X\to Y$ is a morphism and a class $x\in H^\ast(X,\mathbf{Q})$ of weight $i$ is in the image of $f^\ast$, then there is a class $y$ of weight $i$ that is mapped to $x$. My guess would be that this property breaks down even if one considers algebraic varieties, let alone analytic one, but I can't find a counter-example.
So I would like to ask: is it possible to find smooth complex algebraic varieties $X$ and $Y$, a proper map $f:X\to Y$ and a class $x\in H^\ast(X,\mathbf{Z})$ which is in the image of $f^\ast$ but is not the image of any class of the same weight?
upd: in this question the weights are defined using algebraic compactifications; this does not depend on a particular compactification since for any two algebraic compactifications there is a third one that dominates them both.