Henry Davis was searching for his first hit of spring training, a stretch that endured 17 at-bats but proved worth the wait.

Davis ended his drought by hitting a leadoff home run, sparking a game that saw the Pittsburgh Pirates catcher go 1 for 2 with two RBIs, along with a walk and a hit by a pitch.

What Davis started, Marcell Ozuna finished by hitting his first homer of the spring as the Pirates rallied for an 8-6 win over the Baltimore Orioles on Saturday afternoon in a Grapefruit League game before 6,596 at LECOM Park in Bradenton, Fla.

Davis crushed an 0-1 changeup from Trevor Rogers 396 feet at a 100.6-mph exit velocity to left-center to give the Pirates a 1-0 lead in the bottom of the first inning.

Davis also was responsible for another RBI, even though it didn’t require a swing. After Ryan O’Hearn singled to right and Nick Gonzales reached on a pop fly to second, Jake Mangum was hit by a pitch with two outs in the second to load the bases. Davis drew a full-count walk to score O’Hearn and give the Pirates a 2-0 lead.

The Orioles tied it in the third, when Taylor Ward singled to center and Adley Rutschman sent Pirates starter Carmen Mlodzinski’s first-pitch fastball 381 feet to right-center for a two-run homer to make it 2-2.

Mlodzinski allowed two runs on seven hits and five strikeouts without a walk over five innings, throwing 48 of his 64 pitches for strikes. He has a 2.92 ERA in four appearances (two starts) this spring.

Baltimore took the lead in the sixth, as Blaze Alexander singled and Dylan Beavers drilled a 3-0 fastball from Cam Sanders for a 367-foot shot to right field for another two-run homer and a 4-2 lead.

The Pirates cut their deficit in half in the bottom of the sixth. O’Hearn, who went 2 for 3 to improve his batting average to .429 (6 for 14), hit a leadoff double and was replaced by pinch runner Shalin Polanco, who advanced to third on a flyout to left by Gonzales and scored on a two-out single to center by Jared Triolo to make it 4-3.

Ward won an ABS challenge to draw a walk off Justin Lawrence in the seventh, stole second base and scored on Rutschman’s single to center for a 5-3 lead.

But the Pirates rallied, as Nick Yorke singled, Enmanuel Valdez drew a walk and Ozuna sent a 1-1 slider 400 feet to left-center, a three-run shot to give the Pirates a 6-5 lead.

Righty reliever Isaac Mattson extended his scoreless streak to 5 1/3 innings with a scoreless eighth inning, and Billy Cook hit a two-run homer in the bottom of the eighth to stretch the lead to 8-5. Cook is 5 for 10 with two doubles, two homers and five RBIs in his last five games.

Note: Right-hander Jose Urquidy is scheduled to start for the Pirates against lefty Shane McClanahan and the Tampa Bay Rays at 1:05 p.m. Sunday at Charlotte Sports Park in Port Charlotte.