Let $X, Y$ be two smooth projective absolutely irreducible algebraic varieties over a finite field $\mathbb F_q$. Assume that they have the same dimension $d$ and that all the Betti numbers agree, i.e. $b_j(X) = b_j(Y)$ for all $j \in \{0, ..., 2d\}$.
Question
Is there an integer $N \geq 1$ such that: $$\text{ if } |X(\Bbb F_{q^r})| = |Y(\Bbb F_{q^r})| \text{ for all } r \in \{1, ..., N\} \quad\text{ then }\quad Z(X/\mathbb F_q, T) = Z(Y/\mathbb F_q, T),$$ i.e. we have equality of the zeta functions once the first $N$ values of the cardinalities over $\Bbb F_{q^r}$ agree.
Thoughts
It works if $d=1$, i.e. for curves of the same genus $(b_1(X) = 2g(X))$, and in fact by Poincaré duality, we only need to know $|X(\Bbb F_{q^r})|$ for $1 \leq r \leq g(X)$ to deduce the full zeta function. This is because if $P_1(T) = 1 + a_1 T + ... + a_{2g} T^{2g}$ is the numerator of $Z(X,T)$ and if we set $S_r := |X(\Bbb F_{q^r})| - (q^r+1)$, then
$$\frac{d}{dT} [\log( \; Z(X, T) (1-T)(1-qT) \; )] = \frac{P_1'(T)}{P_1(T)}$$ so that $$a_1 = S_1, 2a_2 = S_1 a_1 + S_2 = S_1^2 + S_2, 3a_3 = S_1a_2 + S_2a_1 + S_3, ...$$
Intuitively, in general I would say that $N = \sum_{j=1}^{2d-1} b_j(X)$ could work (because this is the number of unknown coefficients of the $P_j$'s appearing in $Z(X,T)$ as a rational function — recall that $P_0(T) = 1 - T, P_{2d}(T) = 1 - q^d T$ and $P_i(0) = 1$ for all $i$).
I think that yes, but the proof has to use the Weil conjectures.
We know that $Z(X/\mathbb{F}_q)=\frac{N_X}{P_X}$ and same for $Y$, with $N_X,N_Y$ integral polynomials of bounded degree (by the sum $\beta_1$ of the Betti numbers of odd index), and $P_X,P_Y$ are integral polynomials of degree bounded by the sum $\beta_0$ of Betti numbers of even index.
Let $\Pi=P_XP_Y$. Assume that for all $1 \leq r \leq \beta_0+\beta_1$, $|X(\mathbb{F}_{q^r})|=|Y(\mathbb{F}_{q^r})|$. Then the coefficients from $0$ to $\beta_1+\beta_0$ of the power series expansions of $Z(X),Z(Y)$ are equal.
Thus, it is the same for the coefficients from $0$ to $\beta_1+\beta_0$ of $\Pi Z(X)$ and $\Pi Z(Y)$. But $\Pi Z(X)$, $\Pi Z(Y)$ are polynomials of degree $\beta_1+\beta_0$. So it follows $\Pi Z(X)=\Pi Z(Y)$ is $Z(X)=Z(Y)$.