Is there any requirement to cite recent literature in publications? Recently I submitted my first paper to a philosophy journal and got a rejection. This is of course nothing unusual, but as someone with a STEM background, I was surprised by the reason for the rejection: While there were no complaints regarding contents or correctness, it was felt that the paper failed to cite and engage with the recent literature on the topic.

The latter is indeed true: I did ignore the latest papers in the field and only referenced a handful of "classic" papers from the last century. But I also thought this was okay, as it seemed to me that the recent literature didn't add much to what was already covered by the classic papers, and was in any case not essential to the discussion.

Now, I'm not here to complain about having my paper rejected, or to argue about who's wrong or right. I just would like to know whether the requirement to cite the recent literature is a humanities-specific thing, or whether this is a common requirement in most fields. For instance, I imagine that if I had submitted a maths or computer science paper that referenced only a handful of classic and old, but relevant papers, my own paper, if correct and substantial, would have been accepted.

Note: Since people seem to misunderstand me, a bit of extra clarification: I don't have a problem with citing recent literature, if that's what it takes to get a philosophy paper published. I just want to know if this is more or less the same in most fields, including maths and CS. In the latter, so I believe, it's less of a big deal to cite the latest papers as long as the submitted paper correctly solves some well-known open problem.
This question seems to be based on a common misconception about the role of citations (see this question for a related issue).  Citations aren't just there to list content your work builds on; they're also there to provide the reader with context and motivation.

The reason you should be citing recent work is to help the reader.  If you were familiar with various unsuccessful solutions, it's likely that some of them motivated the successful one, even if only by identifying things that couldn't work, and that merits a citation.  Even if not, many of your readers are likely to be people who've thought a lot about one or more of those unsuccessful approaches; you're in the best position to explain how your approach differs.

(I'm writing from the perspective of mathematics, by the way.)