Hi J.,
My son went through a similar experience in fifth grade which was actually heightened because it was his first year at a new school. He was very frustrated with math. I re-count the days as one hour of homework and two hours of crying. It was a very difficult time for all of us, but we got through it and he is now a highly capable sixteen year old looking forward to college. Here's what worked for us.
I empathized with him and approached him with a loving heart. No matter how angry and upset he was I just kept being as understanding and nurturing as I could be. I sat right by him for the three hours. I made cocoa and encouraged frequent breaks. I took an interest in re-learning math and he took an interest in teaching me. Even if I knew that part, I pretended that I didn't so he could work through the explanation. And like your child once he got started, knowing I was there for support, he was willing to keep plodding through.
I also coached him on how to work with his fantastic teacher. Each night we made a note of the problems that caused the most angst and he made sure to ask his teacher about them the next day. I definitely would work with the teacher on this issue. As it turned out, his teacher already had a plan for helping kids who were struggling.
I sat right next to him for three hours until the Christmas break. After, the new year something had flipped and he didn't need me to sit there the whole time. Of course, we still continued with the cocoa and breaks.
There is actually scientific evidence that supports the practice of frequent breaks when trying to learn.
I hope this helps,
D.