Maybe all it took was Magoon Gwath seeing the cardinal and blue uniforms with the green V of Fresno State.

For Gwath, this is basketball’s version of comfort food.

San Diego State’s 7-foot forward had his breakout game as a redshirt freshman last season in Fresno, then had another big game when the Bulldogs came to Viejas Arena two months later.

And devoured them again Saturday night at Viejas Arena in a sloppy 71-52 win that kept the Aztecs tied with Utah State atop the Mountain West at 5-0.

Gwath returned to the starting lineup after two games coming off the bench and finished with 18 points, eight rebounds and two blocks in 22½ minutes. He scored SDSU’s first two baskets in each half.

His career averages in three games against Fresno State: 19 points, nine rebounds, three blocks.

The only bad part: The Aztecs skip the road trip to Fresno this season in the Mountain West’s unbalanced schedule, although there’s always a chance they could meet in the conference tournament in March in Las Vegas.

Gwath’s big night was a welcome development for the Aztecs on a night when almost everyone else struggled, as was a comfortable win after three straight nail-biters — a two-point game at San Jose State with five minutes to go, triple overtime at home against Boise State and a tight game at Nevada after trailing 14-2.

The Aztecs (11-4) squeaked out wins in those three and now have won five straight entering a tricky stretch with three of the next four on the road and the lone home game against a 4-1 New Mexico team that won 91-49 at Air Force on Saturday.

They probably would have won by even more Saturday night had it not been for a sloppy first half that had coach Brian Dutcher angrily calling timeout with 3:43 to go and screaming as his players shuffled to the home bench.

Or put it this way: When Dutcher signaled for timeout, the Aztecs were shooting 40% overall, were 2 of 12 on 3s and had eight turnovers … and still led by 13.

That’s because the Bulldogs were even worse. Playing without point guard Zaon Collins, who rolled an ankle in practice Friday, they didn’t get off a shot for the game’s opening 3:14, didn’t make a basket for the first 6:35, didn’t make their second basket until 8:54 left in the first half and midway through the period were on pace to commit 40 turnovers.

If you wanted a sequence that encapsulated the Aztecs’ night, it came on a fast break seven minutes in.

Instead of slowing to shoot a layup, BJ Davis tossed the ball off the backboard in hopes of creating a for-the-ages highlight reel dunk by the trailing Pharaoh Compton.

Except the pass was slightly mistimed. Compton had to collect it, land and lay it up in for an easy two.

The Aztecs led 36-21 at intermission and quickly grew the margin to 29 behind a screen-and-roll layup, a dunk and a 3-pointer by Gwath. But then they lapsed into sloppy sleepwalk mode again, and the Bulldogs ultimately drew within 13.

It’s the kind of effort that was good enough Saturday but likely won’t be over the next four games: at Wyoming at 7,220 feet; home against New Mexico and former UC San Diego coach Eric Olen; at Grand Canyon, where the Aztecs lost their last two trips; and at UNLV, where they lost last year.

Reese Dixon-Waters had 13 points but on 5-of-15 shooting. Miles Byrd had 10 points, six rebounds, six assists and two steals in just 23 minutes — and the Aztecs were plus-24 points with him on the floor.

The only other player with more than four points was freshman Elzie Harrington with eight. Davis, their leading scorer, took only four shots and finished with two points.

The Aztecs shot 40% after topping 50% in each of their last four games but compensated with a 48-35 edge on the boards and a 23-0 edge in second-chance points.

Fresno State (7-9, 1-4) got 16 points and 14 rebounds from DeShawn Gory but shot 30.5% and had 17 turnovers.

Notable

The game at Wyoming (5 p.m. PST, CBS Sports Network) is the Aztecs’ final trip to Laramie before moving to the Pac-12 next season … A moment of silence was observed before the game for Terry Wymer, the officiating coordinator from the Big Ten consortium that supplies referees to the Mountain West. He passed away in October at age 66 … With Gwath starting, Jeremiah Oden returned to the bench.