Both sides confirmed the incident in Kalbajar region, which lies just west of disputed Nagorno-Karabakh.
Armenia’s defence ministry said the six were doing engineering work. Azerbaijan said they had "tried to mine supply routes" near Azeri army positions.
Azerbaijan made big gains in Nagorno-Karabakh before a November peace deal.
The Nagorno-Karabakh conflict in the Caucasus mountains flared up again last September for six weeks. Fighting in the 1990s left Armenia controlling the disputed territory. Internationally, Nagorno-Karabakh is recognised as part of Azerbaijan.
The Armenians said the six soldiers had not crossed the border before they were captured.