Azerbaijan on Thursday accused Iran of a drone attack on its territory that injured four civilians, and it vowed to retaliate in a sign that the war in the Middle East was spreading.