  The Pila-Wilkie theorem states that if a set $X\subseteq \mathbb R^n$ is
definable in an o-minimal structure $\mathcal R$ and contains `many' rational
points, then it contains an infinite semialgebraic set. In this paper, we
extend this theorem to an expansion $\widetilde{\mathcal R}=\langle \mathcal R,
P\rangle$ of $\mathcal R$ by a dense set $P$, which is either an elementary
substructure of $\mathcal R$, or it is independent, as follows. If $X$ is
definable in $\widetilde{\mathcal R}$ and contains many rational points, then
it is dense in an infinite semialgebraic set. Moreover, it contains an infinite
set which is $\emptyset$-definable in $\langle \overline{\mathbb R}, P\rangle$,
where $\overline {\mathbb R}$ is the real field.
