Gilberto Celestino homered and Luis Arraez picked up three more hits to raise his MLB-best batting average to .336. The Twins moved within a game of AL Central-leading Cleveland.
''We've got to continue to keep playing like that,'' Urshela said.
Gray (7-3) struck out the side in the second inning, all on called third strikes. He got Nicky Lopez and MJ Melendez swinging in the sixth to equal the 10 strikeouts he had against Detroit back on May 24.
Gray exited to a standing ovation when manager Rocco Baldelli pulled him in the seventh after hits by Salvador Perez and Vinnie Pasquantino. Gray had allowed just one hit through six innings.
Including Tuesday's scoreless outing, Gray has surrendered just five total runs over his last five starts.
''I feel good with the baseball in my hand,'' Gray said. ''I want to take the mound with one thought on my brain, and it's to win the game. That's just kind of where I'm at personally.''
Caleb Thielbar took over for Gray with a 3-0 lead with two on and no outs, and kept the shutout intact. Thielbar also helped the Twins out of a jam in Monday's win.
''That's two days in a row for Caleb to come in in huge spots and to absolutely maneuver his way, dominate his way through some hitters,'' Gray said. ''That's huge, what he's done.''
Zack Greinke (4-8) gave up three runs, only one them earned, in six innings. Minnesota scored its first two runs in the second after an error by third baseman Bobby Witt Jr.
Tuesday was the third time this season the 38-year-old Greinke had faced the Twins. The nine hits were the most Minnesota had against him this year.
''I made a lot of good pitches and they were just hitting balls hard all day long,'' Greinke said. ''It was a tough day pitching.''
Leading 3-0, the Twins added three runs in the seventh against reliever Wyatt Mills. An error by second baseman Michael Massey helped Minnesota score three more in the eighth.
''We're right there still in that game with an opportunity again and miss it,'' Royals manager Mike Matheny said. ''You can't let those go.''
Urshela had RBI singles in both the seventh and eighth innings. It marked his first four-hit game as a Twin and the fourth of his career.
The third baseman, who was acquired in an offseason trade from the Yankees, is batting .303 (23 for 76) since July 6.
''I think he's seeing the ball well recently,'' manager Rocco Baldelli said. ''He's had a little bit of success off Greinke in the past. Sometimes that just happens and we don't have explanations for that, but sometimes guys' swings match up just a little bit better against guys' stuff than anyone could ever expect.''
Twins: 2B Jorge Polanco did not play Tuesday, a day after exiting a game with left knee soreness. Polanco injured his knee while sliding into home plate Monday. Baldelli said after Tuesday's game that Polanco did have an MRI earlier in the day, but it didn't reveal any damage. Polanco is considered day-to-day.
LHP Daniel Lynch (4-7, 4.52 ERA) takes the mound for the Royals in the series finale, facing the Twins for the third time this season. Minnesota counters with RHP Tyler Mahle (6-7, 4.26), who will make his third start in a Twins uniform since being acquired from Cincinnati in a trade earlier this month.
More AP MLB: https://apnews.com/hub/MLB and https://twitter.com/AP-Sports
Copyright 2022 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.