Compensation of flight delays in the EU for trips over several stages

I have a question about compensation under EU law for my flight. We booked tickets between Venice and Lima with Air Canada. We had two stops, one in Brussels and one in Montreal. Our first two flights were at the time, but the last one (Canada-Peru) was delayed by 4 hours. Can we still claim compensation, even if delays occur outside the EU, since our original ticket comes from Italy? All tickets were purchased with the same reservation made directly with Air Canada. They were not purchased as part of a multi-city trip or other.

Thank you for your help