What is the impact of gaps on CV in academic job search?
If I saw an application from someone with this history and the cover letter explained why the applicant had taken time off work, I would treat the application as though those two years simply didn't exist.  I think that most search committees would also be willing to give a candidate (especially a female candidate dealing with family issues) that kind of treatment. 

As @StrongBad noted in a comment, there's a much bigger issue in that it could be extremely difficult for your spouse to find a tenure track research oriented faculty position in the city where you will be working.  The job market is so competitive that even the most qualified applicants have to apply at lots of schools across the country in order to find a tenure track position.  

For what its worth I've served on many search committees in applied mathematics over the years.  My institution is a lesser ranked research university.