Wagging was the act of moving one's tail side to side.
In 2151, Porthos wagged his tail. (ENT: "Fortunate Son")
In 2269, one of Adam's songs included the line "Gonna lick his hand and wag my tail." (TOS: "The Way to Eden")
In 2373, Kathryn Janeway speculated that the movement of an unstable wormhole (the Barzan wormhole) was like the wagging tail of a dog. (VOY: "False Profits")