Assume that $N$ is a large positive integer.
The complex function $$f(z) = \frac{e^{i \tan z}}{z} $$ has a simple pole at the origin and essential singularities at the half-integer multiples of $\pi$.
Let's integrate $f(z)$ around a rectangular contour that has vertices at $z= \pm \pi N$, $z=\pm \pi N+i\sqrt{N}$ with small clockwise-oriented semicircles of radius $\epsilon$ about the origin and about the points $z= \pi \left(k+\frac{1}{2} \right)$, $k=-N, -N+1, \ldots -1, 0, 1, \ldots N-2, N-1$.
The contour is similar to the contour used in this answer.
In the upper half-plane, $$|e^{i \tan z}| = |e^{i \tan (x+iy)}| =\exp \left(-\frac{\sinh 2y}{\cos 2x + \cosh 2y} \right) \le 1.$$
Since the height of the contour is $\sqrt{N}$ and the magnitude of $e^{i \tan z}$ is bounded in the upper half-plane, the estimation lemma tells us that integral vanishes on the left and right the sides of the rectangle vanish as $N \to \infty$.
And since the magnitude of $e^{i \tan z}$ is bounded in the upper half-plane, the integral vanishes on the small semicircles about the half-integer multiples of $\pi$ as $\epsilon \to 0$.
So we have
$$ \text{PV} \int_{-\infty}^{\infty} \frac{e^{i \tan x}}{x} \, dx - i \pi \,\text{Res}[f(z),0] -\lim_{N \to \infty} \int_{-N}^{N} \frac{e^{i \tan (t+i\sqrt{N})}}{t+i\sqrt{N}} \, dt =0. $$
But since the magnitude of $e^{i \tan z}- \frac{1}{e}$ tends to zero exponentially fast as $\Im(z) \to +\infty$, we can replace $e^{i \tan(t+ i \sqrt{N})}$ with $\frac{1}{e}$. (Specifically, it's going to zero like $\frac{2}{e} e^{-2 \, \Im(z)}$.)
Therefore,
$$\text{PV} \int_{-\infty}^{\infty} \frac{e^{i \tan x}}{x} \, dx - i \pi - \frac{1}{e} \lim_{N \to \infty} \int_{-N}^{N} \frac{1}{t+i\sqrt{N}} \, dt =0. $$
But if we integrate $g(z) = \frac{1}{z}$ around a similar contour (minus the semicircles about the half-integer multiples of $\pi$), we get
$$ \underbrace{\text{PV} \int_{-\infty}^{\infty} \frac{dx}{x}}_{0} - i \pi \underbrace{\text{Res}[g(z),0]}_{1} - \lim_{N \to \infty} \int_{-N}^{N} \frac{1}{t+i\sqrt{N}} \, dt = 0.$$
Therefore, $$ \lim_{N \to \infty} \int_{-N}^{N} \frac{1}{t+i\sqrt{N}} \, dt = - i \pi, $$ and
$$ \text{PV} \int_{-\infty}^{\infty} \frac{e^{i \tan x}}{x} \, dx - i \pi - \frac{1}{e} (-i \pi) =0.$$
Equating the imaginary parts on both sides of the equation, we have $$\int_{-\infty}^{\infty} \frac{\sin (\tan x)}{x} \, \mathrm dx = \pi \left(1- \frac{1}{e} \right).$$
UPDATE:
Integrating the function $\frac{z}{z^{2}+a^{2}} \, e^{i \tan z} $ around almost the same contour shows that $$\int_{-\infty}^{\infty} \frac{x}{x^{2}+a^{2}} \, \sin(\tan x) \, \mathrm dx = \pi \left(e^{- \tanh a}- \frac{1}{e} \right). $$