Materials: How to compare two vectors?
You can use a modification of a Vector Product. Here is the node setup:



Let me explain how this works. First, Geometry > Normal gets the normal vector of each point on the object. The Separate XYZ and Combine XYZ nodes respectively isolate the z-component of each vector and return that value as a vector. Because vectors that lie more in the xy-plane than others will have a smaller z-component, it is necessary to normalize every vector.

At this point, it would generally do to use the Dot Product to compare the magnitudes of the two vectors. The Dot Product maximizes when vectors are parallel and minimizes when they are perpendicular. For some reason (someone please edit if they know why), the Dot Product is rather glitchy in this case. So I substituted the Cross Product, which maximizes when vectors are perpendicular and minimizes when they are parallel. This had the desired effect. I compared the z-vectors with the Geometry > Incoming vector, which gives the vector from a point to the camera.

Normal vector: A vector that is perpendicular to the surface at the given point.
Normalize: To make a vector or vectors all a standard length (usually 1 unit).

Vector math is a fascinating subject. Consider reading more about the cross product (sometimes referred to as the "Vector Product") here.

Edit 1

As the OP referenced, the above solution separates out the view from the $\pm$z-axis for material selection. Now for a custom view, the so-called pink arrow. Try as I might, I could not find an automated solution that directly pulls the rotation data from the pink arrow in the scene.

First, a note on how vectors are defined in three dimensions.


Google Images

A vector, like the one represented by the pink object above, has an x, y, and z-component. In the picture above, to "get" from the origin of the graph to the tip of the vector would require you to move +2 units in the x-direction, +3 units in the y-direction, and +5 units in the z-direction.

This data can be directly (by hand) entered into the node editor. To compare the camera view to the pictured vector, enter the pictured data into the Vector Math > Normalize node, as follows. This has the added advantage of normalizing (see above) the vector at the same time.



Now, with mostly the same node setup...



...we get this result (my pink vector is the (2,3,5) one). Note that the sphere aligns with the pink vector while Suzanne aligns with the z-axis.



For your vector of choice, use the above info on defining vectors to define yours and substitute its components.

Component: A part of a vector that gives its magnitude in one, specific dimension.

Edit 2

Looks to me like my edit worked, but you defined your vector in terms of local as opposed to global coordinates. I have modified your nodes in your .blend file to line up with the pink vector as follows.

I took these two screenshots of the global coordinates -- first of the base of the vector and second of the tip of the vector:





Let's call the ordered pair of the base $(x_0,y_0,z_0)$ and the ordered pair of the tip $(x_1,y_1,z_1)$. From this data, it is possible to find each component of the vector by subtracting$$n_0-n_1=\vec{n}$$
Therefore,$$\begin{align}
x_1-x_0&amp;=\vec{x}=0.799\\
y_1-y_0&amp;=\vec{y}=-2.203\\
z_1-z_0&amp;=\vec{z}=0.657\\
\end{align}$$

If we plug these values into the Normalize node, we get the expected behvior.



Ordered pair: A group of elements denoting the one dimensional translations necessary to move from the origin to a point.