Mahazi joins the Wanderers from Victorian National Premier League club Moreland Zebras but made his name in more than 90 matches for Melbourne Victory, winning both the Championship and Premiership in 2014/15 as well as the FFA Cup in 2015.
The 26 year old defensive midfielder said he was looking forward to a new challenge with the Red & Black.
"It's really nice getting to train every day again with high-quality players, so I'm excited to start the season, get fit and hopefully get on the park in Round 1," said Mahazi.
"Everyone knows Western Sydney Wanderers are one of the biggest clubs in the A-League, especially their fan base, and I've always said it's been my favourite away trip to play at as an opposition player.
"The Wanderers are a club I want to be at, they've been very successful since coming into the Hyundai A-League and I want to be part of that.
"I want to bring the best out of myself this season. I want to play as many games as possible, I want to get as fit and as strong as possible and play my best football for the club.
"I also want to be a bit more of a leader on the park, I was a captain last season so I've grown up a lot in the last year, so hopefully as a team, we can push for the Top Two and end up in the Grand Final."