The riverboat had left the city of Iquitos on Wednesday with around 30 tourists on board to see towns along the river, local media reported.
When the boat anchored in the middle of the river for one stop, the gunmen boarded it and stole goods worth around $20,000 (Â£15,000).
None of the tourists, most of them American, were hurt.
The robbery happened early in the morning.
The gunmen arrived on a small boat and boarded the riverboat, threatening the crew and tourists with small calibre weapons.
The boat's captain was hit with a pistol handle but was not seriously injured. None of the rest of the crew were hurt.
The police arrived soon after the incident and all the tourists were evacuated to a safe location.
Eight masked gunmen in Peru have robbed tourists enjoying a luxury riverboat cruise on the Amazon.