I would say Nintendo kind of helped start their decline (though the big N also did themselves no favors in the early 90s), and even slightly lost their lead against Sega in the US until the release of Donky Kong Country kinda sealed the deal for the SNES victory over Genesis there. But Sega had the tough task of having to chip away at a dominant market leader at the time and compete with Nintendo's typically high-quality games. Nintendo also seemed to at least indirectly coax them into a sort of hardware arms race and other projects over software, which brought lots of dead weight to Sega and dragged the company down shortly thereafter.
Like the protagonist in Genji II, against a Giant Enemy Crab, Sony inflicted "Massive Damage" on Sega by essentially outdoing them in their own game of drawing third parties their way, aggressive price points, and an overall "edgy" gaming philosophy. They also had superior hardware and a massive quantity of games. Basically there was virtually no reason to opt for the Saturn over the PSX..
By the time MS came along, Sega was in its final throes I'd say anyway, but the original Xbox was sort of the final nail in the coffin. There simply wasn't room in the industry for four major consoles/competitors at that point, and Sega was muscled out by the other three.
So it's hard to say as all three companies played a role in the decline and demise of Sega, but Sony probably was the most impactful (and ironically Sega shooting themselves in the foot - that probably is a close second). Microsoft simply sealed the deal. The war against Nintendo was an epic one, and it took its toll, but Sega was still riding fairly high by the mid 90s, especially in America, and could have rebounded if the right moves were made.
TV Shows Currently Watching:
You can follow me as I rant about sports and Overwatch, as well as post random metal videos, @StephenML8 on Twitter.