An ellipse has always a major axis and a minor axis. And the foci lie on major axis.
In your question, the major axis is y-axis and its length is 6. The minor axis is x-axis and its length is 4.
Formula for eccentricity:
where b is length of minor axis
and, a is length of major axis
And the focus: where a is the length of major axis.
The formula usually given in textbooks assume that a is the major axis whereas in your question a is the minor axis...hence we have to swap a and b