With two laps to go to reach victory lane, they even touched wheels.
"We're going wheel to wheel like 226 miles an hour or something," O'Ward said. "It's pretty insane, I have to say."
Their thrilling race came to an abrupt end when Romain Grosjean crashed with one lap remaining, moments after Newgarden had surged ahead of O'Ward. Newgarden crossed the finish line under caution for a second consecutive victory at Texas, the third of his career.
"We had a great car. I don't know what else to say other than our car was fast," Newgarden said while wearing Texas' traditional celebratory cowboy hat presented to the winner. "I don't know if it fits right. I apologize to any cowboys that would make fun of my fit."
Newgarden and O'Ward were so dominant Sunday -- they combined to lead 214 of the 250 laps -- that at one point in the race, they were the only two drivers on the lead lap. They frantically swapped the lead over the final third of the race, and neither showed any inclination to lift off the gas in the fight for the win.
There were periods of white-knuckle pack racing, three-wide passes and jaw-dropping bravery, as drivers were unafraid of Texas' high speeds. IndyCar on Saturday used the entire field to specifically run a second high line around the 1.5-mile speedway in an effort to create a passing lane.
The result was 482 passes for position -- nearly 200 more than in last year's race. The 26 lead changes was the most at Texas since 2001, a span of 26 IndyCar races.
Newgarden credited the spirited racing to seven-time NASCAR champion Jimmie Johnson, who last year made his IndyCar debut on an oval at Texas and finished sixth. Johnson won a NASCAR-record seven Cup races at Texas.
"I think it's the Jimmie Johnson effect," Newgarden said. "We were here last year, people were like, 'This Jimmie guy, look at him, he can do it.' I think Jimmie Johnson basically gave everybody confidence this weekend."
The chance for one final thrilling lap ended when Grosjean crashed while running fifth as the leaders took the white flag. Newgarden led a race-high 123 of the 250 laps in his Chevrolet for Team Penske. And it was a solid bounce back from last month's season opener, when Newgarden's engine caught on fire on the downtown streets of St. Petersburg, Florida.
"We are playing a little bit of catch-up. Got a long way to go," Newgarden said. "We are on the board. We were not on the board leaving St. Pete. We're on the board now."
O'Ward, in a Chevy for Arrow McLaren, opened the new IndyCar season with back-to-back second-place finishes. He nearly won the opener at St. Petersburg until an engine blip allowed him to be passed by Marcus Ericsson for the victory.
O'Ward, who led 91 laps on Sunday and used three-wide moves to stay at the front, is IndyCar's new points leader.
"It's been a hell of a start to the year," O'Ward said.
Scott McLaughlin of Penske was sixth and followed by Colton Herta, in his first race without his father, Bryan, as his strategist in a personnel change made at Andretti Autosport. Only seven drivers finished on the lead lap.