You just have to figure out what you can and can't punish. FSmash pushes you too far to punish unless you manage to powershield it and DSmash is too quick on block, so play the baiting game with aerials. Jump away instead of committing to an attack to make him less confident his attacks will land, be ready to respond to his jabs to cover his dash attacks, after trying a frontal offensive a couple of times start jumping over him as he blocks and hit him with Bair to prevent getting punished, set up gaps in your defenses on purpose for Counter.
The important thing here is that getting damaged isn't the main danger against Mac - while still dangerous because of his smashes, the big thing you want to prevent is letting him get a KO Punch up because Ike really can't knock that thing off without putting himself in major danger, so kill him EARLY. Starting from roughly 30% you're going to want to lure him towards the sides then react as soon as you get a jab combo, grab, Fair, Bair, Ftilt, or Counter that sends him off the side. Don't stand too close to the edge lest he punch your toes with his uppercut or Haymaker your face, but all you need is that one last hit to seal the stock, made all the easier by Uppercut's inability to ledgesnap and Haymaker's garbage range.
FSmash will guarantee he's gone, and Eruption may be the easier to hit him with, but unless you sent him relatively high off stage so that he's far away but still able to make it back you probably won't have time to charge it enough to kill - it will, however, send him back into the air, most likely with no double jump in reserve, so chase after him with Fair or Bair to kill him. There's a good chance Mac will go for a last ditch Slip Counter in this predicament, so stay your hand for just a moment to see what he does - which can also double as baiting an airdodge. USmash may accomplish the same thing as Eruption if you're unsure you can avoid a Haymaker, as well, but I'm not sure the forward hitbox can hit him easily when he's going low. I prefer just going for the FSmash, myself, unless I happen to get a back throw on him right at the edge at ~60% - I'm not 100% sure but I believe that's enough time for Eruption to kill him, since he's so light, and there's nothing he can do in that situation, and even if it's not a kill at that damage range the grab probably filled up his KO meter and the Eruption will get rid of it.
KO Punch also can't kill Ike after just two Dtilts from 0%, I'm pretty sure - 16% isn't enough to take down a heavyweight.