In the short term, yes, this is perfectly possible. Especially if country 1 houses the backbone nodes that supply internet to country 2, although that's just convenience rather than a hard requirement.
In September 2021, New Zealand suffered wide-spread internet outages when someone launched a DDoS attack against an individual... although the outage itself may in fact have been because of the response from an internet provider. This is far from the first time this has happened, and the results have been significantly worse in some cases. I recall a couple of decades ago when NZ's internet went out for 3 days because a massive DDoS attack cooked several backbone routers in Australia. Some terrible decisions by the backbone providers had left the country without adequate backup links, and only those with dedicated satellite links were able to communicate outside NZ the entire time.
Similar things have happened in other countries. In 2011 a 75 year old lady in Georgia (the European country, not the US state) was digging for scrap copper and damaged a fibre cable. Sadly for Armenia, this cable was the single point of communication with the outside internet. The entire country, and half of Georgia, was offline for more than 5 hours while repair crews worked on fixing the cut section of cable.
So yeah, you can take countries down fairly easily if they don't have adequate fallbacks. If you control the territory where all of their internet links are then you can 'accidentally' cut a few key cables and they'll be offline until either you fix the cables again or they manage to get internet through some other territory. And even if you don't have direct access to those cables you can do a lot of damage with targetted DDoS attacks.
Country 1 could have the help of other governments too, and would choose this as an alternative of prolonging the war and causing more deaths.
Depending on the size of the country and the complexity of internet use you could be causing more deaths if the outage lasts for more than a few days. Pretty much everything we do these days relies on the internet. Take away access to the internet and within a few days everything goes to hell. Supply chains break down without access to their cloud-based systems. Banking systems rely so heavily on internet access that all of your POS systems go offline immediately, making it impossible to purchase anything with your cards. People get desperate and start doing stupid things like looting local stores for food. Hospitals can't access medical records. Civil unrest is already high because of the spit, so next thing you know you have riots, looting, destruction, cats and dogs living together in harmony... you know, all the chaos.
But you'd never actually do that, right? After all, internet access is a fundamental human right these days. You'd have to be some kind of monster.