Utley, who had three hits, drove in the tying run on a triple to deep center field. He soon scored on a Domonic Brown ground out to give the Phillies the lead. Ruf added one more on a solo home run, his fourth of the season.
Philadelphia tagged Edwin Jackson (7-12) for seven runs and 10 hits in six innings.
Trailing 9-5 in the ninth, the Cubs scored three runs off Phillies closer Jonathan Papelbon before pinch-hitter Thomas Neal flew out with men on the corners to end it.
Kyle Kendrick (10-8) allowed five runs and six hits in six innings. He also had an RBI single.
Utley plated the Phillies' first run in the first inning on a single to left field to score Michael Young.
The Cubs then responded with four runs in the second, capped off by Donnie Murphy's three-run homer, his first hit of the season.
Anthony Rizzo hit a solo home run in the third to make it 5-2. It was Rizzo's fourth homer in six games.
Ruf extended his on-base streak to 33 straight games with an RBI double in the third to cut the Cubs' lead to 5-4. Ruf's streak, which dates back to last year, is the longest active in the major leagues and the longest for the Phillies since Utley's mark of equal length from September 2008 to April 2009.
Young knocked in a run with a two-out double in the sixth, and Carlos Ruiz homered in the eighth.
Philadelphia is 2-13 in its last 15 games.