The 2nd District covers parts of South and Southwest Philly and Center City.
A petition to contest the election results must be filed in the Common Pleas Court within five days of the election results being certified.
"I am extremely gratified by today's outcome, and I look forward to getting started on the general election," Johnson said in a statement. "If this campaign has taught us anything, it's that you have to fight for every vote and that every vote counts."
Community activist Tracey Gordon finished third with 1,555, and Damon Roberts, a lawyer, got 319 votes, which were declared void because he withdrew from the race on May 5. Roberts, who ran for the seat four years ago, withdrew too late to have his name removed from the ballot.
Rep. Johnson will face Republican Ivan Cohen, who ran unopposed in the primary, in the Nov. 8 general election.
Johnson is serving his second term in the state House's 186th District. Capozzi has been active for many years in real estate and helped establish the Sports Complex Special Services District.
They were seeking the seat being vacated in January by Council President Anna Verna, who is retiring after 35 years in office.
The Republican primary election for mayor remains undecided. Karen Brown, the Democratic committeewoman recruited by the local GOP to challenge John Featherman, leads by 57 votes out of nearly 16,500 cast. The City Commission is now counting 177 GOP absentee ballots and 20 alternative ballots. Military ballots can also arrive as late as today.
A result in that race could come by noon today. The winner faces Mayor Nutter, who's seeking a second term, in the general election.