The other answers are absolutely correct; let me add to them by giving an explicit example of such a set.
There is (think Godel numbering) a way to represent linear orderings with domain $\mathbb{N}$ by real numbers. Similarly, we can represent infinite sequences of natural numbers by real numbers. So we can define the following set:
$X$ is the set of pairs $(r, s)$ of real numbers such that $r$ codes a linear ordering and $s$ codes an infinite descending sequence through (the linear order coded by) $r$.
Let $Y$ be the projection of $X$ onto the first coordinate; then $Y$ is the set of reals which code non-well-orderings (or which fail to code linear orderings). This set, it turns out, is non-Borel! Meanwhile - as long as the coding scheme we used above is non-silly - $X$ is Borel.
Most of this is fairly straightforward; the hard part, of course, is proving that $Y$ is indeed not Borel. This is a bit technical, so I'm not going to get into it here; the citations in the other answers say more.