The Welsh Parliament backed calls for a ceasefire in Gaza in a vote on Wednesday evening.
Mark Drakeford abstained as 11 of his Labour backbenchers supported a Plaid Cymru motion deploring the conflict.
Rhun ap Iorwerth, Plaid leader, said both Hamas' attacks on Israel and the "collective punishment" of Gaza were unjust and inhumane.
Some 19 Senedd members - including the Welsh Conservative group and four Labour MSs - opposed his stance.
The First Minister Mr Drakeford - who has stuck close to UK Labour leader Sir Keir Starmer's position of calling for a humanitarian pause - sat in the parliament for the debate but did not take part.
A total of 13 Welsh government ministers abstained - the Senedd was told they do not vote on international affairs.
Both Mr Drakeford and Sir Keir have been under pressure to back a ceasefire from within their own parties.
Shouts of "free Palestine" were heard from the public gallery after the result was announced.
The Plaid Cymru motion, supported by 24 Members of the Senedd (MSs), condemned the "horrifying attacks carried out by Hamas against Israeli civilians".
It also condemned "the Israeli government's indiscriminate attacks on Gaza, resulting in the death of thousands of innocent" Palestinians.
The Senedd has no jurisdiction over international affairs but its politicians often express their own views on the topic.
More on Israel-Gaza war
Follow live: Latest updates
From Israel: Pain still raw a month after Hamas attacks
History behind the story: The Israel-Palestinian conflict
Mr ap Iorwerth, opening the debate on Wednesday evening, gave a speech where he talked about the experience of people living in Wales who have relatives in Gaza.
One, he said, lost 18 members of his family in three airstrikes, while another told her sister to write the names of their children on their arms, in case their parents are killed.
He told Senedd: "It is about telling the world that it's time to answer the plight of Gaza's children."
Four Labour members supported an amendment from Conservative MS Darren Millar, which instead of a ceasefire called for a "suspension of hostilities to allow for the establishment of humanitarian corridors".
Mr Millar, Clwyd West MS, said the 7 October attacks by Hamas, which killed 1,400 people, were the worst atrocity committed against the Jewish people since the holocaust.
But the politician, who was the only Conservative to speak, said: "We have all looked on in horror at the growing humanitarian crisis in Gaza."
He said: "Hamas must release their hostages unconditionally and lay down their arms. Israel must then stop the bombing," he said.
Mr Millar told the chamber that the Israeli embassy had held a briefing at the Senedd showing politicians "chilling images" from the 7 October attacks.
"The severity of the indiscriminate physical and sexual violence inflicted on Israeli citizens, old and young, was so shocking that I dare not repeat some of what was shared," he said.
He was supported by the Labour Senedd member for Blaenau Gwent Alun Davies, who said: "Don't believe for a moment that I supported this amendment because I don't want to see peace."
"That means that we have to support the people of Israel in taking away the infrastructure of Hamas," he added.
'History will judge us'
John Griffiths, Labour MS for Newport East, was among the members of the Labour group supporting Plaid's motion.
"This is a moment of truth - history will judge us all," he said.
"The madness, carnage and inhumanity in Gaza and Israel has to stop.
"The daily bombardment of Gaza causing the death of over 10,000 people including over 4,000 children must end, and so the distractions of homes and the blockade of life saving supplies. The hostages must be released."
Delyth Jewell, Plaid Cymru MS for South Wales East, said her former colleagues at charity ActionAid had lost "all contact with my former colleagues in Gaza".
"That torture went on for a full two days, and they remained trapped in what is quickly becoming a graveyard in Gaza."
With Mr Drakeford sat next to her, Labour Social Justice Minister Jane Hutt responded for the government.
"It's clear from this debate that this Senedd is united in our horror at the events which have unfolded in Israel and Gaza over recent weeks," she said.
"Ministers will be abstaining on the motion and the amendment today, in keeping with the Welsh government's established approach of abstaining on motions relating to foreign affairs which are not within the remit of the Senedd."