Fluid mixing plays a fundamental role in many natural and engineered processes, including groundwater flows in porous media, enhanced oil recovery, and microfluidic lab-on-a-chip systems. Recent developments have explored the effect of viscosity contrast on mixing, suggesting that the unstable displacement of fluids with different viscosities, or viscous fingering, provides a powerful mechanism to increase fluid-fluid interfacial area and enhance mixing. However, existing studies have not incorporated the effect of medium heterogeneity on the mixing rate. Here, we characterize the evolution of mixing between two fluids of different viscosity in heterogeneous porous media. We focus on a practical scenario of divergent-convergent flow in a quarter five spot geometry prototypical of well-driven groundwater flows. We study by means of numerical simulations the impact of permeability heterogeneity and viscosity contrast on the breakthrough curves and mixing efficiency, and we rationalize the nontrivial mixing behavior that emerges from the competition between the creation of fluid-fluid interfacial area and channeling.