Vertical angles are two angles whose sides are opposite rays. This means that the rays point in opposite directions forming straight lines. Examining the figure, we can see that this is the case only for one pair of sides.
Since only one pair of sides are opposite rays, ∠2 and ∠5 are not vertical angles.