SANTA CLARA >> Another fourth-quarter collapse led to another 49ers’ loss against an NFC West rival on Sunday.

Two weeks after faltering on the road to the Los Angeles Rams, the 49ers blew a 10-point lead and exited with a 24-23 loss to the Arizona Cardinals, who went ahead on a 35-yard field goal with 1 1/2 minutes to go.

The 49ers (2-3) could not respond in kind, not when Brock Purdy had a pass deflected and intercepted for the second time on a staggering hot day at Levi’s Stadium, where the temperature was a record 89 degrees at kickoff.

The 49ers now have their quickest turnaround yet this season, with a visit Thursday night to first-place Seattle. The 49ers are 0-2 in NFC West action, having turned a 24-14 lead at Los Angeles into a 27-24 defeat two weeks ago.

The 49ers had positioned themselves for a strong yet strange divisional win Sunday, up until a couple of key plays triggered their demise.

No mistake loomed larger than Jordan Mason’s first career lost fumble. It came a most inopportune time and place: at the Cardinals’ 11-yard line with 6:11 remaining. The 49ers led 23-21 at that point, but the Cardinals (2-3) responded with their game-winning drive.

Another play that contributed mightily to the 49ers’ losing approach: kicker Jake Moody exited with an ankle injury just before halftime. Moody had to make the tackle on a kickoff that followed Deommodore Lenoir’s touchdown on a 61-yard return of a blocked field goal, which put the 49ers ahead 19-10.

That lead climbed to 23-10 when fill-in kicker Mitch Wishnowsky hit a 26-yard field goal as the first half expired, and those points were how the 49ers’ capitalized off Nick Bosa’s second career interception.

The temperature rose to 98 degrees by 3:34 p.m., when the 49ers saw their 10-point lead cut to 23-21. Kyler Murray completed a 2-yard touchdown pass to tight end Elijah Higgins, followed by a James Conner 2-point conversion run.

Murray finished with 82 rushing yards (seven carries) and 195 passing yards (19-of-30, one touchdown, one interception).

Purdy, aside from the two interceptions, completed 19-of-35 passes for 244 yards, with a first-quarter touchdown pass to George Kittle and a season-best connection with Brandon Aiyuk (eight catches, 147 yards).

Mason (14 carries, 89 yards) was on the cusp of his fourth 100-yard game in five career starts in place of the injured Christian McCaffrey. Mason wouldn’t get his hands on the ball again in the 49ers’ two snaps after his fumble.

Four drives before halftime had the 49ers at first-and-goal, with only one resulting in a touchdown (4-yard pass to George Kittle). Two ended with Moody field goals (28 and 20 yards), and the other score came on Mitch Wishnowsky’s 26-yard field goal as Moody’s replacement.

The 49ers’ second touchdown — and a 20-10 lead — came from the most unlikeliest source this season: special teams. Lenoir scored it on a 61-yard return of a field-goal attempt blocked by Jordan Elliott.

More special-teams chaos followed. Moody injured his right ankle making the tackle on the ensuing kickoff. That forced punter (and Moody’s usual holder) Wishnowsky into action as he nonchalantly nailed a 26-yard field goal that sent the 49ers into halftime with a 23-10 lead.