This situation of a spouse that is a full-time student and also works is covered in IRS Publication 503 in the section titled Earned Income Limit:
You or your spouse is a student or not able to care for self. Your spouse who is either a full-time student or not able to care for himself or herself is treated as having earned income. His or her earned income for each month is considered to be at least $250 if there is one qualifying person in your home, or at least $500 if there are two or more.
Spouse works. If your spouse works during that month, use the higher of $250 (or $500) or his or her actual earned income for that month.
Spouse qualifies for part of month. If your spouse is a full-time student or not able to care for himself or herself for only part of a month, the full $250 (or $500) still applies for that month.
Here's how this works: For each month of the year, you look at whether or not your wife was a full-time student for even part of the month. If so, compare your wife's actual earned income for that month to $500 (because you have two dependents), and use the larger amount as her earned income amount for that month. Add up all twelve months, and you have your wife's earned income for the purposes of the dependent care benefit limit.
As an example, if she was a full-time student for at least ten months, with your two dependents at home she would be over the $5000 mark even if she didn't have any income from a job at all.