In an interview, Foucault responds to a question about Marxist methodology in his writing:

“[Interviewer] G.R. But does this reference in The Archaeology of Knowledge mean that, in a certain way, Marx is at work in your own methodology?
“FOUCAULT Yes, absolutely.”
(Source: Foucault, Michel. Politics, Philosophy, Culture: Interviews and Other Writings 1977-1984, New York: Routledge, 1988, p. 46)
Related: Explaining Postmodernism: Skepticism and Socialism from Rousseau to Foucault.