A sufficient condition for a functor $u:I\to J$ to induce a cofinal functor $Tw(I)\to Tw(J)$ is that $u$ is universally cofinal (i.e. any base change of $u$ is cofinal). Another sufficient condition is that $u$ is universally final. In fact, as may be seen in the proof below, we only need that the base change of $u$ (or of $u^{op}$, respectively) along any cartesian fibration is cofinal.
The key observation to understand this is the following. For any functor $u:I\to J$, there are two canonical functors factoring $Tw(u):Tw(I)\to Tw(J)$
$$ Tw(I)\to (I^{op}\times I)\times_{(J^{op}\times I)}Tw(J) \quad \text{and} \quad Tw(I)\to (I^{op}\times I)\times_{(I^{op}\times J)}Tw(J) $$$$ Tw(I)\to (J^{op}\times I)\times_{(J^{op}\times J)}Tw(J) \quad \text{and} \quad Tw(I)\to (I^{op}\times J)\times_{(J^{op}\times J)}Tw(J) $$
which are both cofinal. [If we take the convention that $Tw(I)$ if a cartesian fibration over $I^{op}\times I$ this comes from Proposition 5.6.9 in this book on $\infty$-categories; note that the author of this book calls final what many other people call cofinal, as may be seen from Theorem 6.4.5 in loc. cit.]. Therefore, it is sufficient to prove that one of the projections
$$ (I^{op}\times I)\times_{(J^{op}\times I)}Tw(J)\to Tw(J) \quad \text{or} \quad (I^{op}\times I)\times_{(I^{op}\times J)}Tw(J)\to Tw(J) $$$$ (J^{op}\times I)\times_{(J^{op}\times J)}Tw(J)\to Tw(J) \quad \text{or} \quad (I^{op}\times J)\times_{(J^{op}\times J)}Tw(J)\to Tw(J) $$
is cofinal. But the first (second) one is a pullback along the cartesian fibration $Tw(J)\to J$ (along the cartesian fibration $Tw(J)\to J^{op}$) of the functor $u$ (of the functor $u^{op}$, respectively).
A final remark on the proof: if we work in the model of quasi-categories say, then pullbacks along cartesian fibrations in the $1$-category of quasi-categories are homotopy pullbacks with respect to the Joyal model structure. In particular, in the proof above, it does not matter if we work with pullbacks in the $1$-categorical sense or in the $\infty$-categorical sense. That is also a way to see that the proof above is model free.
Finally, a sufficient condition for $u$ to satisfy the hypothesis above is that $u$ remains a weak homotopy equivalence after any base change. This condition is satisfied by any functor $u:I\to J$ which is smooth or proper with weakly contractible fibers (e.g. any cartesian or cocartesian fibration with weakly contractible fibers); this follows easily from Proposition 7.1.12 in loc. cit. An example which is not a (co)cartesian fibration is the functor $\Delta_{/ N(J)}\to J$ (sending a sequence of maps $j_0\to\cdots\to j_n$ to $j_n$) for any category $J$ (where $\Delta_{/ N(J)}$ is the category of simplices of the nerve of $J$); this belongs to a larger class of examples provided by Proposition 7.3.8 in loc. cit.