In the third minute of second-half stoppage time, Alves darted into space to meet a free-kick delivered from a deep position on the right by Joao Moutinho and directed the ball inches inside the right post.
Portugal, who were without injured captain Cristiano Ronaldo, wrap up their tournament warm-up schedule with a game against the Republic of Ireland in Boston on Tuesday.
The Irish, who have missed out on World Cup qualification, achieved a 1-1 draw with Brazil-bound Costa Rica in Philadelphia.
Zambia gave Japan a fright in Tampa before sliding to a 4-3 defeat.
Japan fell 2-0 behind during the first half, conceding a close-range header from Christopher Katongo and a sweetly-struck 20-yard strike from Nathan Sinkala.
Keisuke Honda's penalty cut the deficit and Shinji Kagawa had a stroke of luck for an equaliser when his apparent cross bypassed everyone on its way into the net.
Honda prodded Japan in front, only for Zambia's Lubambo Musanda to strike a 25-yard effort that deflected over Shusaku Nishikawa to haul Zambia back to 3-3.
Yoshito Okubo pinched a last-gasp winner, showing sharp control to bring down a long pass and composing himself before producing a powerful left-footed finish.
Croatia and Australia are both heading to the finals, and it took a Nikica Jelavic strike to separate them in Salvador. Croatia's 1-0 victory came courtesy of Jelavic's strike off the underside of the crossbar in the 58th minute.
Greece beat non-qualifiers Bolivia 2-1 in New Jersey with goals from Panagiotis Kone and Kostas Katsouranis. Rudy Cardozo replied from long range for Bolivia.
Fredy Guarin's late 30-yard strike capped a 3-0 win for Colombia over Jordan in Buenos Aires. Colombia had led through a pair of penalties, converted by James Rodriguez and Juan Cuadrado.