SANTA CLARA, Calif. (AP) Coach Jason Garrett saw all he needed out of quarterback Dak Prescott on just one drive.

Prescott made the most of his brief appearance in the preseason opener for Dallas by throwing a 30-yard touchdown pass to rookie Michael Gallup on his only drive before the San Francisco 49ers rallied with two late touchdowns to beat the Cowboys 24-21 Thursday night.

''I thought it was a good drive by our offense, a good mix of run and pass,'' Garrett said. ''Dak made some good decisions. He made a really nice run too keep the drive alive. We got the one-on-one opportunity down the sideline. Michael made a really good release and it was a good throw and catch.''

Nick Mullens threw a 7-yard TD pass to Richie James Jr. with 18 seconds left to cap the comeback. Jeremy McNichols scored on a 1-yard run with 4:24 to go for San Francisco.

San Francisco's Jimmy Garoppolo didn't fare as well as Prescott in his first game action since signing a $137.5 million, five-year contract this offseason. Garoppolo completed 3 of 6 passes on his one drive.

''We're trying to do something different things and see what works and what doesn't,'' Garoppolo said. ''We haven't been in that situation in a year and you try to get things rolling.''

More concerning for the 49ers was the fact that six players left with injuries in the first half with the most concerning ones being shoulder injuries to tight end George Kittle and running back Matt Breida that could sideline them for ''some time,'' according to coach Kyle Shanahan.

''It's what you scares you about training camp, it's what scares you about the preseason,'' Shanahan said. ''You just want the game to end.''

Prescott sat out the first exhibition game last season but got one series of action against the 49ers this year and looked sharp. He completed all three of pass attempts and converted a third-and-9 with a 12-yard scramble.

He capped his night with the deep ball to Gallup, who beat Jimmie Ward down the sideline. Ward got the start at cornerback in place of Richard Sherman, who is nursing a hamstring injury.

With the release of three-time Pro Bowl receiver Dez Bryant and the retirement of 15-year tight end Jason Witten, the Cowboys are searching for receiving threats this preseason. Gallup, a third-round pick out of Colorado State, has been impressive so far in camp.

''That's a good feeling,'' Gallup said. ''Especially for me being so young and being a rookie and everything, I needed that boost of confidence. It was a good feeling.''

NATIONAL ANTHEM

No players on either team kneeled during the national anthem, although 49ers receiver Marquise Goodwin did raise his right fist throughout the song. The Niners have been at the center of the protests during national anthem ever since Colin Kaepernick began kneeling two years ago. Eric Reid protested last year but both players are no longer with the team. Linebacker Eli Harrold also kneeled during the anthem the past two years but stood to start this season.

INJURIES

The Niners had a parade of injuries early, starting with LB Malcolm Smith limping off with a hamstring issue on the opening drive. TE George Kittle and backup RB Matt Breida left with shoulder injuries. Thomas and backup tackle Garry Gilliam were sidelined by concussions and Harrold had a lower leg injury.

Cowboys OL Marcus Martin limped off the field in the second half with a toe injury, S Marqueston Huff left with a groin injury, and WR Marchie Murdock had an ankle injury.

NOTEWORTHY PERFORMANCES

Joe Thomas got the start at linebacker for Dallas in place of Sean Lee and delivered an interception against C.J. Beathard on a tipped pass by Kavon Frazier. ... Cowboys rookie RB Bo Scarbrough had a 28-yard run and scored a 1-yard TD in the second quarter. ... James had four catches for 46 yards and fellow rookie Dante Pettis caught a 53-yard pass .

HELMET FOUL

There was one penalty under the new rule prohibiting players from leading with their helmets. San Francisco LB Elijah Lee was called for the infraction on a tackle against Scarbrough in the third quarter.

NEXT UP

Cowboys: Host Cincinnati on Aug. 18.

49ers: Visit Houston on Aug. 18.

---

More AP NFL: https://apnews.com/tag/NFLfootball and https://twitter.com/AP-NFL

Copyright 2018 by AP. Any commercial use or distribution without the express written consent of AP is strictly prohibited.