Q:

"It was him" auf Deutsch

In English, we could answer the question "Who ate the cake?" with 

It was him.

I don't know the reason why we use the accusative "him", even though the person is the subject of eating the cake, not the object.
In German, is it the same?

Wer aß den Kuchen? Es war ihn.

A:

German is different and uses the nominative:

Er war's. Er war es. Das war er.

Note the word order; es can't be in initial position here.

