Changing the in-vertex of the knows edge between marko and vadas to peter and using a different label for the edge:
gremlin> g = TinkerFactory.createModern().traversal()
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
gremlin> g.V(1).outE().inV().path().by('name').by(valueMap(true))
==>[marko,[label:created,id:9,weight:0.4],lop]
==>[marko,[label:knows,id:7,weight:0.5],vadas]
==>[marko,[label:knows,id:8,weight:1.0],josh]
gremlin> g.V(1).as('a').outE('knows').as('e1').filter(inV().hasId(2)).
V(6).addE('knows2').from('a').as('e2').
sideEffect(select('e1').properties().unfold().as('p').
select('e2').property(select('p').key(), select('p').value())).
gremlin> g.V(1).outE().inV().path().by('name').by(valueMap(true))
==>[marko,[label:knows2,id:13,weight:0.5],peter]
==>[marko,[label:created,id:9,weight:0.4],lop]
==>[marko,[label:knows,id:8,weight:1.0],josh]