Gryffindor wins the House Cup in books 1, 2, and 3, but it is never stated which one of the 4 houses (Gryffindor, Ravenclaw, Slytherin, and Hufflepuff) wins in books 4, 5, 6, and 7? Does Rowling ever give an answer?
The answer is, unfortunately, we don't know.
Rowling hasn't said, and it isn't present in any of the books. Having said that:
Years 1, 2 & 3
It is known that Gryffindor won all 3 of these years.
It is unknown who won, if anybody won. The Great Hall was decorated in Black to mourn the loss of
and as a result no house colours were present. However, it is likely the house cup was not awarded that year, partly due to the untimely death and also partly due to the fact that this particular year included the TriWizard Tournament.
Having said that, if the House Cup were awarded, it would possibly be awarded to Gryffindor due to Harry technically winning the tournament.
It is unknown who exactly won the cup this year, but it is again likely that it was not awarded.
Due to Umbridge and her appointment of the Inquisitorial Squad, the house point system went completely out the window. The squad consisted purely of Slytherins and each of them had the power to give and deduct points. By the end of the year, Gryffindor had no points at all, and Ravenclaw and Hufflepuff almost certainly had close to none.
McGonagall awarded a large number of points to Gryffindor in wake of the battle at the Ministry of Magic, so it is possible that she Dumbledore'd a victory for Gryfiindor much like the first book, but it isn't known for certain. I imagine due to the odd Umbridge-related circumstances, the cup wasn't awarded that year either.
The house cup wasn't exactly at the forefront of everyone's minds. I don't think it was awarded to anyone that year.
Although, while not much is known about the house cup, we do know that Gryffindor won the Quidditch Cup.
I mean, a lot of things happened. I highly doubt the House Cup was awarded this year either, considering the state the school was in by the end of it.
If the cup were awarded, it would probably go to Gryffindor, given the actions of the Golden Trio and Neville, and also because "let's just have Gryffindor win the cup every year" is quite possibly a decision Rowling opted for.
Long story short, we don't know and Rowling doesn't seem to have told anyone, but it is highly likely that the house cup was not awarded at all in Years 4-7, with the slight possibility of Gryffindor winning each of those years.