District Chiefs Ricky Taylor and Travis Ford drove 14 hours from Nashville to attend the ceremony.
"The fire department has a brotherhood like no other in the world," said Taylor, who will celebrate his 38th year as a firefighter Monday.
"It affects all of us. It's like losing a family member," Taylor said.
Ken McMullen, assistant deputy chief with the fire department in Calgary, Alberta, flew to Toronto, then to Philadelphia to attend.
"We'll come from wherever to show support," he said.
Under a clear blue sky, a procession that included Mayor Nutter marched down the blocked-off road, leading the way for Ladder 10, to which Neary was assigned, and Engine 7, which carried his casket.
Three volleys of rifle fire were followed by the ringing of a bell and then the playing of Taps for the 37-year veteran of the Philadelphia Fire Department.
Fellow city firefighters carried the casket to a stand next to where Neary's family was seated.
The flag covering his casket was carefully folded and then presented to Neary's wife, Diane.
For Neary and Sweeney's coworkers with Ladder 10 and Engine 7, who share the station house at Kensington and Castor Avenues, the last five days have been ones of wrenching grief - the loss not just of colleagues, but of brother firefighters.
Neary was a respected mentor and a leader by example in the firehouse and on the fire ground, say those who served under him.
"A true officer, leader, and gentleman," Firefighter Jack Eltman of Engine 7 said earlier in the week. "He was a father figure first because of all the knowledge he brought to the table."
Sweeney, 25, was the little brother of the company, the men said.
"His smile, his eagerness, his smarts - I don't know how to put that into words," Eltman said. "He was a true brother, a true friend."
Eltman and other firefighters who worked alongside Neary and Sweeney served as pallbearers and in the honor guard during the memorials.
The men had prepared for the duty at the city Fire Academy Thursday, the training serving as a temporary distraction from the sorrow.
Eltman said he and his colleagues had been preparing for the "two longest days" of their lives. "But no matter what us firemen brothers are going through, we know it's nothing in comparison to what the families are going through."
At the Givnish mortuary, the Sweeney family, escorted by police, visited with the Neary family during a private viewing before the funeral home was opened to the public.
Neary graduated from Father Judge High School in 1970 and joined the Philadelphia Police Department the following year.
In 1974, he switched to the Fire Department. He recently had applied for the city's Deferred Retirement Option Program.
Neary was a fishing and boating enthusiast. A remembrance booklet provided to visitors at the funeral home featured a cover photo of Neary holding what appears to be a large tuna he caught.
Neary is survived by his wife and grown children, Robert, Christopher, and Dianne, as well as his mother, Virginia, a brother, a sister, and two grandchildren.
Neary was a "tremendous leader," said Fire Capt. William Tillman. And Sweeney, who joined the department on July 6, 2006, had "grown in that short amount of time to be a true firefighter."
Tillman said of the Sweeney family that it was "amazing how they're holding up under the circumstances."
He added: "The community support is everything for us. We appreciate their caring, their giving, and their support. It's tremendous."
Lisa Ford, an assistant principal of Bishop McDevitt High School, from which Sweeney graduated in 2005, said the school had embraced the fallen firefighter.
"He is part of our family. You support your family in good times and bad times, and McDevitt is a family," Ford said.
Sweeney's mother, Marian, is a science teacher at the school, and Sweeney's sisters also attended McDevitt.
Faculty members recalled Sweeney as a talented actor and member of Royal Masque, a theater troupe.
Guidance counselor Carol Anne Dominello said Sweeney was shy but was transformed on stage.
"He was the prince when he was Prince Charming," she said of his role in Cinderella. And he became the lion in The Wizard of Oz, she said.
Dominello said the school had flown the flag at half-staff and said a prayer for Sweeney and his family every morning.
The line of visitors at St. Cecilia continued for more than two hours. At one point, it stretched about a block. It drew those who knew Sweeney at different points in life, and those who never got a chance to know him.
Nick Gorman, 25, worked with his close friend Sweeney at the Tri-Hampton Rescue Squad in Feasterville and the Warminster Rescue Squad.
"I haven't been able to actually think straight, really. It's just devastating," he said, recalling how he had tried to call and text Sweeney after hearing that firefighters had been hurt.
"I'm still hoping that I get a response from him, but I know it's not going to come," he said before joining the line to go into church.
In addition to his mother, Sweeney is survived by his father, David, and sisters Suzanne Swedlige, Sarah Sweeney, and Deborah Sweeney.
Contact Darran Simon at 856-779-3829, firstname.lastname@example.org, or follow @DarranSimon on Twitter.
Inquirer staff writer Mike Newall contributed to this article.