The yeas and nays are entered in the public journal upon the desire of one-fifth present. Section 5 of Article I of the Constitution says:
Each House shall keep a Journal of its Proceedings, and from time to time publish the same, excepting such Parts as may in their Judgment require Secrecy; and the Yeas and Nays of the Members of either House on any question shall, at the Desire of one fifth of those Present, be entered on the Journal.
Here is the The Journal of the House of Representatives entry for the vote you ask about:
It is also visualized here: httpsRoll Call Votes://www.govtrack.us/congress/votes/38-2/h480 House Vote #480 in 1865 (38th Congress
That same Section also allows the House to keep any part of its proceedings secret that it judges to require secrecy. The history of this practice is reviewed nicely by ohwilleke on this answer over at the Politics StackExchange.
