Combinatorial restriction on choosing adjacent objects
Your labeling approach is indeed best. There are $4$ spaces between bars, each of which must contain a book, and a space at each end, each of which may contain no books. If $x_k$ is the number of books in space $k$ for $k=0,1,\dots,5$ (with the spaces numbered from left to right), you want the number of solutions in non-negative integers to the equation
$$x_0+x_1+x_2+x_3+x_4+x_5=9$$
subject to the condition that $x_1,x_2,x_3,x_4\ge 1$. This is essentially the same as counting the solutions in non-negative integers to
$$x_0+x_1+x_2+x_3+x_4+x_5=5\;:$$
we just pretend that we’ve already placed one book in each internal space, thereby accounting for $4$ of the $9$ extra books, and allocate the remaining $5$ arbitrarily. The answer is therefore
$$\binom{5+6-1}{6-1}=\binom{10}5\;.$$
(See this article if you’ve not seen that before at all, though I suspect that you have.)
Let me generalize (your question is obtained for $n = 14$ and $k = 5$):
Let $n$ and $k$ be nonnegative integers. Let $\left[n\right] = \left\{1,2,\ldots,n\right\}$. A set $S$ of integers is called lacunar if it contains no two consecutive integers (i.e., there exists no $s \in S$ satisfying $s+1 \in S$).
Find the number of all $k$-element lacunar subsets of $\left[n\right]$.
The answer is $\dbinom{n-k+1}{k}$ when $k \leq n+1$ (and obviously $0$ in all other cases). For a proof, see the solutions to Exercise 3 (a) on UMN Fall 2017 Math 4707 homework set #2. The first solution is the bijective argument some are alluding to in this thread. The second is a straightforward but annoying ("thanks" to the $k \leq n+1$ condition) induction on $n$.
Your $n = 14$ books correspond to the $n$ elements of $\left[n\right]$, in the order in which they appear on the shelf.