We study mixing of two fluids of different viscosity in a microfluidic channel or porous medium. We show that the synergetic action of alternating injection and viscous fingering leads to a dramatic increase in mixing efficiency at high Péclet numbers. Based on observations from high-resolution simulations, we develop a theoretical model of mixing efficiency that combines a hyperbolic mixing model of the channelized region ahead and a mixing-dissipation model of the pseudosteady region behind. Our macroscopic model quantitatively reproduces the evolution of the average degree of mixing along the flow direction and can be used as a design tool to optimize mixing from viscous fingering in a microfluidic channel.