Description of Wand of Magic Missiles states:
This wand has 7 charges. While holding it, you can use an action to expend 1 or more of its charges to cast the magic missile spell from it.
Description is pretty clear that "you" casts spell from the wand, so while you are right it does not count as an attack, Sanctuary ends because character using this wand casts a spell.
On the other end o the spectrum is Ring of Shooting Stars. It's first use allows user to cast a spell. Second one, though:
Ball Lightning. You can expend 2 charges as an action to create one to four 3-foot-diameter spheres of lightning. The more spheres you create, the less powerful each sphere is individually.
When a creature other than you comes within 5 feet of a sphere, the sphere discharges lightning at that creature and disappears.
Here it is pretty clear that user is not attacking, not casting a spell, and it is the sphere that hurts the opponent, not the ring bearer. Thus, Sanctuary continues.
Bottom line: There is no fast and easy answer that applies to all items and all uses of the same item. You'll have to read the item's description.