This is false without further assumption on $R$. Just consider a smooth projective curve $X$ over $R=\mathbb Z_{p\mathbb Z}$ with generic fiber $X_{\mathbb Q}$ of genus $>1$. Let $Y_\mathbb Q$ be the finite set of rational points of $X_{\mathbb Q}$ and $Y$ the Zariski closure of $Y_\mathbb Q$ in $X$. Then $X(\mathbb Z_{p\mathbb Z})=X_\mathbb Q(\mathbb Q)$ (by valuative criterion of properness), but the latter is equal to $Y(\mathbb Z_{p\mathbb Z})$.
Suppose now $R$ is complete (and $X_K$ is smooth), then $X(R)\setminus Y(R)$ is dense in $X(R)$. To see this, fix a section $S\in X(R)$ and let $x_0\in X(K)$ be the generic fiber $S$. As $X_K$ is smooth at $x_0$, Zariski locally around $x_0$ we have an étale quasi-finite morphism $X\to \mathbb A^d_K$ which maps $x_0$ to $(0,..., 0)$. The theorem of implicit functions implies that a small open (analytic) neighborhood of $x_0$ in $X(K)$ is a polydisk. As $Y(K)$ (Zariski locally) is contained in the zero locus of some non-zero (analytic) function $f$, no small polydisk centered at $x_0$ is entirely contained in $Y(K)$ (otherwise $f=0$ by induction on $d$). So any small polydisk centered at $x_0$ contains a point of $X(K)\setminus Y(K)$. To finish, it is easy to see that a small enough open (analytic) neighborhood $U$ of $x_0$ is contained in $X(R)$. This proves the claim (leaving some details to the readers...).
If $R$ is excellent and henselian, the result still hold by algebraic approximation (M. Artin), see "Néron models", § 3.6. But his requires heavy machinery.
Let's terminate with a counterexample when $X_K$ is not smooth. Let $R=\mathbb Z_p$ (complete), $X=\mathrm{Spec} R[x,y]/(x^2-py^2).$ Then $X(R)$ is reduced to one section $x=y=0$. Take $Y$ equal to this section.